Spaces:
Sleeping
Sleeping
Update apps/intro.py
Browse files- apps/intro.py +11 -6
apps/intro.py
CHANGED
@@ -7,6 +7,13 @@ import pandas as pd
|
|
7 |
import os
|
8 |
import joblib
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
def app():
|
11 |
word_to_embed_list = st.session_state['embed_list']
|
12 |
cat_list = st.session_state['cat_list']
|
@@ -20,12 +27,10 @@ def app():
|
|
20 |
|
21 |
|
22 |
if st.button("Embed"):
|
23 |
-
with st.spinner("👑
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
FILENAME = "umap_embed_3d_all-MiniLM-L6-v2.sav"
|
28 |
-
umap_model= joblib.load(cached_download(hf_hub_url(REPO_ID, FILENAME)))
|
29 |
|
30 |
word_to_embed_list.append(word_to_embed)
|
31 |
st.session_state['embed_list'] = word_to_embed_list
|
|
|
7 |
import os
|
8 |
import joblib
|
9 |
|
10 |
+
def init_models():
|
11 |
+
model_name = 'sentence-transformers/all-MiniLM-L6-v2'
|
12 |
+
model = SentenceTransformer(model_name)
|
13 |
+
REPO_ID = "peter2000/umap_embed_3d_all-MiniLM-L6-v2"
|
14 |
+
FILENAME = "umap_embed_3d_all-MiniLM-L6-v2.sav"
|
15 |
+
umap_model= joblib.load(cached_download(hf_hub_url(REPO_ID, FILENAME)))
|
16 |
+
|
17 |
def app():
|
18 |
word_to_embed_list = st.session_state['embed_list']
|
19 |
cat_list = st.session_state['cat_list']
|
|
|
27 |
|
28 |
|
29 |
if st.button("Embed"):
|
30 |
+
with st.spinner("👑 Embedding your input"):
|
31 |
+
|
32 |
+
init_models()
|
33 |
+
|
|
|
|
|
34 |
|
35 |
word_to_embed_list.append(word_to_embed)
|
36 |
st.session_state['embed_list'] = word_to_embed_list
|