Spaces:
Runtime error
Runtime error
taskswithcode
commited on
Commit
·
56e7f3c
1
Parent(s):
85f28d9
Added fix
Browse files- app.py +4 -3
- view_count.txt +1 -1
app.py
CHANGED
|
@@ -17,6 +17,7 @@ CLUSTERING="3"
|
|
| 17 |
|
| 18 |
|
| 19 |
use_case = {"1":"Finding similar phrases/sentences","2":"Retrieving semantically matching information to a query. It may not be a factual match","3":"Clustering"}
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
|
|
@@ -35,10 +36,10 @@ def get_views():
|
|
| 35 |
except:
|
| 36 |
data = 0
|
| 37 |
data += 1
|
| 38 |
-
ret_val = data
|
| 39 |
-
st.session_state["view_count"] = data
|
| 40 |
with open(view_count_file,"w") as fp:
|
| 41 |
fp.write(str(data))
|
|
|
|
|
|
|
| 42 |
else:
|
| 43 |
ret_val = st.session_state["view_count"]
|
| 44 |
return "{:,}".format(ret_val)
|
|
@@ -170,7 +171,7 @@ def app_main(app_mode,example_files,model_name_files):
|
|
| 170 |
model_names = json.load(fp)
|
| 171 |
curr_use_case = use_case[app_mode].split(".")[0]
|
| 172 |
st.markdown("<h5 style='text-align: center;'>Compare popular/state-of-the-art models for tasks using sentence embeddings</h5>", unsafe_allow_html=True)
|
| 173 |
-
st.markdown(f"<div style='color: #4f4f4f; text-align: left'>Use cases for sentence embeddings<br/> • {use_case['1']}<br/> •  
|
| 174 |
st.markdown(f"<div style='color: #9f9f9f; text-align: right'>views: {get_views()}</div>", unsafe_allow_html=True)
|
| 175 |
|
| 176 |
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
use_case = {"1":"Finding similar phrases/sentences","2":"Retrieving semantically matching information to a query. It may not be a factual match","3":"Clustering"}
|
| 20 |
+
use_case_url = {"1":"https://huggingface.co/spaces/taskswithcode/semantic_similarity","2":"https://huggingface.co/spaces/taskswithcode/semantic_search","3":""}
|
| 21 |
|
| 22 |
|
| 23 |
|
|
|
|
| 36 |
except:
|
| 37 |
data = 0
|
| 38 |
data += 1
|
|
|
|
|
|
|
| 39 |
with open(view_count_file,"w") as fp:
|
| 40 |
fp.write(str(data))
|
| 41 |
+
ret_val = data
|
| 42 |
+
st.session_state["view_count"] = data
|
| 43 |
else:
|
| 44 |
ret_val = st.session_state["view_count"]
|
| 45 |
return "{:,}".format(ret_val)
|
|
|
|
| 171 |
model_names = json.load(fp)
|
| 172 |
curr_use_case = use_case[app_mode].split(".")[0]
|
| 173 |
st.markdown("<h5 style='text-align: center;'>Compare popular/state-of-the-art models for tasks using sentence embeddings</h5>", unsafe_allow_html=True)
|
| 174 |
+
st.markdown(f"<div style='color: #4f4f4f; text-align: left'>Use cases for sentence embeddings<br/> • {use_case['1']}<br/> • <a href=\'{use_case_url['2']}\' target='_blank'>{use_case['2']}</a><br/> • {use_case['3']}<br/><i>This app illustrates <b>'{curr_use_case}'</b> use case</i></div>", unsafe_allow_html=True)
|
| 175 |
st.markdown(f"<div style='color: #9f9f9f; text-align: right'>views: {get_views()}</div>", unsafe_allow_html=True)
|
| 176 |
|
| 177 |
|
view_count.txt
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
1012
|