Update functions.py
Browse files- functions.py +5 -1
functions.py
CHANGED
@@ -21,6 +21,7 @@ import pickle, math
|
|
21 |
import wikipedia
|
22 |
from pyvis.network import Network
|
23 |
import torch
|
|
|
24 |
|
25 |
nltk.download('punkt')
|
26 |
|
@@ -54,7 +55,10 @@ def load_asr_model(asr_model_name):
|
|
54 |
|
55 |
@st.experimental_singleton(suppress_st_warning=True)
|
56 |
def load_sbert(model_name):
|
57 |
-
|
|
|
|
|
|
|
58 |
|
59 |
return sbert
|
60 |
|
|
|
21 |
import wikipedia
|
22 |
from pyvis.network import Network
|
23 |
import torch
|
24 |
+
from InstructorEmbedding import INSTRUCTOR
|
25 |
|
26 |
nltk.download('punkt')
|
27 |
|
|
|
55 |
|
56 |
@st.experimental_singleton(suppress_st_warning=True)
|
57 |
def load_sbert(model_name):
|
58 |
+
if 'hkunlp' in model_name:
|
59 |
+
sbert = INSTRUCTOR(model_name)
|
60 |
+
else:
|
61 |
+
sbert = SentenceTransformer(model_name)
|
62 |
|
63 |
return sbert
|
64 |
|