alexandrecorreia commited on
Commit
ab86a13
·
1 Parent(s): a21b61b

Try fix for static access

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -13,6 +13,7 @@ import requests
13
  import matplotlib.pyplot as plt
14
  from pathlib import Path
15
  from datetime import datetime
 
16
 
17
  from transformers import CLIPProcessor, CLIPModel
18
 
@@ -222,10 +223,11 @@ with gr.Blocks(theme=theme, title="New Look", css=css) as demo:
222
 
223
  def load(image_input):
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:
 
13
  import matplotlib.pyplot as plt
14
  from pathlib import Path
15
  from datetime import datetime
16
+ import time
17
 
18
  from transformers import CLIPProcessor, CLIPModel
19
 
 
223
 
224
  def load(image_input):
225
  file_name = f"{datetime.utcnow().strftime('%s')}.jpg"
226
+ # file_path = static_dir / file_name
227
+ file_path = "static/" + file_name
228
  print(file_path)
229
  image_input.save(file_path)
230
+ return "https://minderalabs-newlook.hf.space/file=" + file_path
231
 
232
  def search(text_input, image_input, image_path, text_relevance, image_relevance, best_seller_score_weight):
233
  if text_input == "" and image_input == None: