Spaces:
Build error
Build error
Update variables.py
Browse files- variables.py +3 -2
variables.py
CHANGED
@@ -74,7 +74,7 @@ def process_tweets(df,df_users):
|
|
74 |
return df_tweets
|
75 |
|
76 |
@st.experimental_singleton(suppress_st_warning=True)
|
77 |
-
def create_vectorstore(texts,model):
|
78 |
'''Create FAISS vectorstore'''
|
79 |
|
80 |
if model == "hkunlp/instructor-large":
|
@@ -85,7 +85,8 @@ def create_vectorstore(texts,model):
|
|
85 |
elif model == "sentence-transformers/all-mpnet-base-v2":
|
86 |
emb = HuggingFaceEmbeddings(model_name=model)
|
87 |
|
88 |
-
docsearch = FAISS.from_texts(texts, emb
|
|
|
89 |
|
90 |
return docsearch
|
91 |
|
|
|
74 |
return df_tweets
|
75 |
|
76 |
@st.experimental_singleton(suppress_st_warning=True)
|
77 |
+
def create_vectorstore(texts,model,username,topic,creation_time):
|
78 |
'''Create FAISS vectorstore'''
|
79 |
|
80 |
if model == "hkunlp/instructor-large":
|
|
|
85 |
elif model == "sentence-transformers/all-mpnet-base-v2":
|
86 |
emb = HuggingFaceEmbeddings(model_name=model)
|
87 |
|
88 |
+
docsearch = FAISS.from_texts(texts, emb,
|
89 |
+
metadatas=[{"source": user,"topic":top,"extraction_time":tme} for user,top,tme in zip(username,topic,creation_time)])
|
90 |
|
91 |
return docsearch
|
92 |
|