Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -125,10 +125,15 @@ def predict(images, input_text, model_name):
|
|
125 |
clip_text_time = time.time() - start_time
|
126 |
|
127 |
start_time = time.time()
|
128 |
-
|
|
|
|
|
|
|
|
|
|
|
129 |
retrieval_time = time.time() - start_time
|
130 |
|
131 |
-
|
132 |
|
133 |
for idx, result in enumerate(results):
|
134 |
image_url = result['url']
|
|
|
125 |
clip_text_time = time.time() - start_time
|
126 |
|
127 |
start_time = time.time()
|
128 |
+
try:
|
129 |
+
results = client.query(embedding_input=text_embeddings[0].tolist())
|
130 |
+
output = ''
|
131 |
+
except:
|
132 |
+
results = []
|
133 |
+
output = 'The server for image retrieval is not working. Please try again later.'
|
134 |
retrieval_time = time.time() - start_time
|
135 |
|
136 |
+
|
137 |
|
138 |
for idx, result in enumerate(results):
|
139 |
image_url = result['url']
|