Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -167,7 +167,7 @@ with gr.Blocks(theme = gr.themes.Soft()) as demo:
|
|
167 |
return gr.Textbox.update(visible=False)
|
168 |
|
169 |
past_searches.change(update_past_search_content, past_searches, past_search_content)
|
170 |
-
|
171 |
def update_with_rag_md(message, llm_results_use = 5, database_choice = index_info, llm_model_picked = 'mistralai/Mistral-7B-Instruct-v0.2'):
|
172 |
prompt_text_from_data = ""
|
173 |
database_to_use = database_choice
|
@@ -181,12 +181,12 @@ with gr.Blocks(theme = gr.themes.Soft()) as demo:
|
|
181 |
arxiv_search_success = False
|
182 |
except:
|
183 |
arxiv_search_success = False
|
184 |
-
|
185 |
if not arxiv_search_success:
|
186 |
gr.Warning("Arxiv Search not working, switching to semantic search ...")
|
187 |
rag_out = get_rag(message)
|
188 |
database_to_use = index_info
|
189 |
-
|
190 |
md_text_updated = mark_text
|
191 |
for i in range(retrieve_results):
|
192 |
rag_answer = rag_out[i]
|
@@ -198,8 +198,8 @@ with gr.Blocks(theme = gr.themes.Soft()) as demo:
|
|
198 |
md_text_updated += md_text_paper
|
199 |
prompt = get_prompt_text(message, prompt_text_from_data, llm_model_picked = llm_model_picked)
|
200 |
save_search_results(message, md_text_updated)
|
201 |
-
return md_text_updated, prompt,
|
202 |
-
|
203 |
def ask_llm(prompt, llm_model_picked = 'mistralai/Mistral-7B-Instruct-v0.2', stream_outputs = False):
|
204 |
model_disabled_text = "LLM Model is disabled"
|
205 |
output = ""
|
|
|
167 |
return gr.Textbox.update(visible=False)
|
168 |
|
169 |
past_searches.change(update_past_search_content, past_searches, past_search_content)
|
170 |
+
|
171 |
def update_with_rag_md(message, llm_results_use = 5, database_choice = index_info, llm_model_picked = 'mistralai/Mistral-7B-Instruct-v0.2'):
|
172 |
prompt_text_from_data = ""
|
173 |
database_to_use = database_choice
|
|
|
181 |
arxiv_search_success = False
|
182 |
except:
|
183 |
arxiv_search_success = False
|
184 |
+
|
185 |
if not arxiv_search_success:
|
186 |
gr.Warning("Arxiv Search not working, switching to semantic search ...")
|
187 |
rag_out = get_rag(message)
|
188 |
database_to_use = index_info
|
189 |
+
|
190 |
md_text_updated = mark_text
|
191 |
for i in range(retrieve_results):
|
192 |
rag_answer = rag_out[i]
|
|
|
198 |
md_text_updated += md_text_paper
|
199 |
prompt = get_prompt_text(message, prompt_text_from_data, llm_model_picked = llm_model_picked)
|
200 |
save_search_results(message, md_text_updated)
|
201 |
+
return md_text_updated, prompt, get_past_searches()
|
202 |
+
|
203 |
def ask_llm(prompt, llm_model_picked = 'mistralai/Mistral-7B-Instruct-v0.2', stream_outputs = False):
|
204 |
model_disabled_text = "LLM Model is disabled"
|
205 |
output = ""
|