Spaces:
Runtime error
Runtime error
taskswithcode
commited on
Commit
•
43f46f9
1
Parent(s):
50cfa80
Add large model alternative link
Browse files
app.py
CHANGED
@@ -85,7 +85,7 @@ model_names = [
|
|
85 |
"sota_link":"https://paperswithcode.com/paper/sgpt-gpt-sentence-embeddings-for-semantic",
|
86 |
},
|
87 |
"paper_url":"https://arxiv.org/abs/2202.08904v5",
|
88 |
-
"Note":"If this large model fails to load , try this ",
|
89 |
"alt_url":"http://www.taskswithcode.com/sentence_similarity/",
|
90 |
"mark":True,
|
91 |
"class":"SGPTModel"},
|
@@ -94,7 +94,7 @@ model_names = [
|
|
94 |
"fork_url":"https://github.com/taskswithcode/sgpt",
|
95 |
"orig_author_url":"https://github.com/Muennighoff",
|
96 |
"orig_author":"Niklas Muennighoff",
|
97 |
-
"Note":"If this large model fails to load , try this ",
|
98 |
"alt_url":"http://www.taskswithcode.com/sentence_similarity/",
|
99 |
"sota_info": {
|
100 |
"task":"#1 in multiple information retrieval & search tasks",
|
@@ -201,8 +201,17 @@ def uncached_compute_similarity(sentences,_model,model_name,main_index):
|
|
201 |
#st.success("Similarity computation complete")
|
202 |
return results
|
203 |
|
|
|
|
|
|
|
|
|
|
|
204 |
def run_test(model_name,sentences,display_area,main_index,user_uploaded):
|
205 |
display_area.text("Loading model:" + model_name)
|
|
|
|
|
|
|
|
|
206 |
model = load_model(model_name)
|
207 |
display_area.text("Model " + model_name + " load complete")
|
208 |
try:
|
|
|
85 |
"sota_link":"https://paperswithcode.com/paper/sgpt-gpt-sentence-embeddings-for-semantic",
|
86 |
},
|
87 |
"paper_url":"https://arxiv.org/abs/2202.08904v5",
|
88 |
+
"Note":"If this large model takes too long or fails to load , try this ",
|
89 |
"alt_url":"http://www.taskswithcode.com/sentence_similarity/",
|
90 |
"mark":True,
|
91 |
"class":"SGPTModel"},
|
|
|
94 |
"fork_url":"https://github.com/taskswithcode/sgpt",
|
95 |
"orig_author_url":"https://github.com/Muennighoff",
|
96 |
"orig_author":"Niklas Muennighoff",
|
97 |
+
"Note":"If this large model takes too long or fails to load , try this ",
|
98 |
"alt_url":"http://www.taskswithcode.com/sentence_similarity/",
|
99 |
"sota_info": {
|
100 |
"task":"#1 in multiple information retrieval & search tasks",
|
|
|
201 |
#st.success("Similarity computation complete")
|
202 |
return results
|
203 |
|
204 |
+
def get_model_info(model_name):
|
205 |
+
for node in model_names:
|
206 |
+
if (model_name == node["name"]):
|
207 |
+
return node
|
208 |
+
|
209 |
def run_test(model_name,sentences,display_area,main_index,user_uploaded):
|
210 |
display_area.text("Loading model:" + model_name)
|
211 |
+
model_info = get_model_info(model_name)
|
212 |
+
if ("Note" in model_info):
|
213 |
+
fail_link = f"{model_info['Note']} [link]({model_info['alt_url']})"
|
214 |
+
display_area.write(fail_link)
|
215 |
model = load_model(model_name)
|
216 |
display_area.text("Model " + model_name + " load complete")
|
217 |
try:
|
run.sh
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
streamlit run app.py --server.port 80
|
2 |
+
|