Spaces:
Runtime error
Runtime error
Commit
·
a62d4b3
1
Parent(s):
9849e1c
New way of loading images into static folder for search
Browse files
app.py
CHANGED
@@ -224,14 +224,8 @@ with gr.Blocks(theme=theme, title="New Look", css=css) as demo:
|
|
224 |
file_name = f"{datetime.utcnow().strftime('%s')}.jpg"
|
225 |
file_path = static_dir / file_name
|
226 |
print(file_path)
|
227 |
-
image_input.save(
|
228 |
-
|
229 |
-
f.write("""
|
230 |
-
{% load static %}
|
231 |
-
<img src="{% static 'img_path.jpg' %}" alt="My image">
|
232 |
-
""")
|
233 |
-
link = f'<a href="file={file_path}" target="_blank">{file_name}</a>'
|
234 |
-
return link
|
235 |
|
236 |
def search(text_input, image_input, image_path, text_relevance, image_relevance, best_seller_score_weight):
|
237 |
if text_input == "" and image_input == None:
|
|
|
224 |
file_name = f"{datetime.utcnow().strftime('%s')}.jpg"
|
225 |
file_path = static_dir / file_name
|
226 |
print(file_path)
|
227 |
+
image_input.save(file_path)
|
228 |
+
return file_path
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
|
230 |
def search(text_input, image_input, image_path, text_relevance, image_relevance, best_seller_score_weight):
|
231 |
if text_input == "" and image_input == None:
|