Spaces:
Runtime error
Runtime error
fixed file paths in app.py
Browse files
app.py
CHANGED
@@ -11,13 +11,13 @@ import uform
|
|
11 |
|
12 |
model_multi = uform.get_model('unum-cloud/uform-vl-multilingual')
|
13 |
|
14 |
-
embeddings = np.load('
|
15 |
embeddings = torch.tensor(embeddings)
|
16 |
|
17 |
#features = np.load('multilingual-image-search/tensors/features.npy')
|
18 |
#features = torch.tensor(features)
|
19 |
|
20 |
-
img_df = pd.read_csv('
|
21 |
|
22 |
def url2img(url):
|
23 |
data = requests.get(url, allow_redirects = True).content
|
@@ -56,6 +56,10 @@ def find_topk(text):
|
|
56 |
# return
|
57 |
|
58 |
|
59 |
-
demo = gr.Interface(find_topk, inputs = 'text', outputs = 'image')
|
|
|
|
|
|
|
|
|
60 |
if __name__ == "__main__":
|
61 |
demo.launch()
|
|
|
11 |
|
12 |
model_multi = uform.get_model('unum-cloud/uform-vl-multilingual')
|
13 |
|
14 |
+
embeddings = np.load('tensors/embeddings.npy')
|
15 |
embeddings = torch.tensor(embeddings)
|
16 |
|
17 |
#features = np.load('multilingual-image-search/tensors/features.npy')
|
18 |
#features = torch.tensor(features)
|
19 |
|
20 |
+
img_df = pd.read_csv('image_data.csv')
|
21 |
|
22 |
def url2img(url):
|
23 |
data = requests.get(url, allow_redirects = True).content
|
|
|
56 |
# return
|
57 |
|
58 |
|
59 |
+
#demo = gr.Interface(find_topk, inputs = 'text', outputs = 'image')
|
60 |
+
demo = gr.Interface(find_topk,
|
61 |
+
inputs = gr.Textbox(label = 'Enter your prompt', lines = 2),
|
62 |
+
output = gr.Gallery(),
|
63 |
+
theme = gr.themes.Glass())
|
64 |
if __name__ == "__main__":
|
65 |
demo.launch()
|