nickmuchi commited on
Commit
ef03b1a
·
1 Parent(s): 4f8e4c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -30,7 +30,12 @@ def load_vectorstore(model):
30
  embed_instruction='Represent the Financial paragraph for retrieval: ')
31
  return FAISS.load_local('vanguard-embeddings-inst', emb)
32
 
 
33
 
 
 
 
 
34
  # vectorstore = load_vectorstore('vanguard-embeddings',sbert_emb)
35
 
36
  _template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.
@@ -122,7 +127,8 @@ with block:
122
  with gr.Row():
123
  embeddings = gr.Radio(choices=model_options_list,value=model_options_list[0], label='Choose your Embedding Model',
124
  interactive=True)
125
-
 
126
  print(embeddings.value)
127
 
128
  vectorstore = load_vectorstore(embeddings.value)
 
30
  embed_instruction='Represent the Financial paragraph for retrieval: ')
31
  return FAISS.load_local('vanguard-embeddings-inst', emb)
32
 
33
+ vectorstore = load_vectorstore(model_options['all-mpnet-base-v2'])
34
 
35
+ def on_value_change(change):
36
+ global vectorstore
37
+ vectorstore = load_vectostore(model_options[change])
38
+
39
  # vectorstore = load_vectorstore('vanguard-embeddings',sbert_emb)
40
 
41
  _template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.
 
127
  with gr.Row():
128
  embeddings = gr.Radio(choices=model_options_list,value=model_options_list[0], label='Choose your Embedding Model',
129
  interactive=True)
130
+ embeddings.observe(on_value_change, names=model_options_list[0])
131
+
132
  print(embeddings.value)
133
 
134
  vectorstore = load_vectorstore(embeddings.value)