Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -200,11 +200,57 @@ def search_glossary(query):
|
|
200 |
# Dropdown for database selection
|
201 |
database_options = ['Semantic Search', 'Arxiv Search - Latest - (EXPERIMENTAL)']
|
202 |
database_choice = st.selectbox('π Select Database', options=database_options, index=0)
|
|
|
|
|
203 |
|
204 |
# Run Button with Emoji
|
205 |
if st.button("π Run"):
|
206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
|
209 |
response1 = client.predict(
|
210 |
message=query,
|
@@ -234,6 +280,8 @@ def search_glossary(query):
|
|
234 |
# Save both responses to Cosmos DB
|
235 |
save_to_cosmos_db(query, response1, response2)
|
236 |
|
|
|
|
|
237 |
|
238 |
|
239 |
# π Search Glossary function
|
|
|
200 |
# Dropdown for database selection
|
201 |
database_options = ['Semantic Search', 'Arxiv Search - Latest - (EXPERIMENTAL)']
|
202 |
database_choice = st.selectbox('π Select Database', options=database_options, index=0)
|
203 |
+
|
204 |
+
|
205 |
|
206 |
# Run Button with Emoji
|
207 |
if st.button("π Run"):
|
208 |
+
|
209 |
+
# π΅οΈββοΈ Searching the glossary for: query
|
210 |
+
all_results = ""
|
211 |
+
st.markdown(f"- {query}")
|
212 |
+
|
213 |
+
#database_choice Literal['Semantic Search', 'Arxiv Search - Latest - (EXPERIMENTAL)'] Default: "Semantic Search"
|
214 |
+
#llm_model_picked Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] Default: "mistralai/Mistral-7B-Instruct-v0.2"
|
215 |
+
|
216 |
+
# π Run 1 - ArXiv RAG researcher expert ~-<>-~ Paper Summary & Ask LLM
|
217 |
client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
218 |
+
response2 = client.predict(
|
219 |
+
message=query, # str in 'parameter_13' Textbox component
|
220 |
+
llm_results_use=5,
|
221 |
+
database_choice="Semantic Search",
|
222 |
+
llm_model_picked="mistralai/Mistral-7B-Instruct-v0.2",
|
223 |
+
api_name="/update_with_rag_md"
|
224 |
+
)
|
225 |
+
st.code(response2, language="python", *, line_numbers=True, wrap_lines=False)
|
226 |
+
|
227 |
+
#llm_model_picked Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] Default: "mistralai/Mistral-7B-Instruct-v0.2"
|
228 |
+
# ArXiv searcher ~-<>-~ Paper References - Update with RAG
|
229 |
+
# client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
230 |
+
result = client.predict(
|
231 |
+
prompt=query,
|
232 |
+
llm_model_picked="mistralai/Mistral-7B-Instruct-v0.2",
|
233 |
+
stream_outputs=True,
|
234 |
+
api_name="/ask_llm"
|
235 |
+
)
|
236 |
+
#st.write('π Run of Multi-Agent System Paper Summary Spec is Complete')
|
237 |
+
st.code(result, language="python", *, line_numbers=True, wrap_lines=False)
|
238 |
+
|
239 |
+
|
240 |
+
# ArXiv searcher ~-<>-~ Paper References - Update with RAG
|
241 |
+
# client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
242 |
+
response1 = client.predict(
|
243 |
+
query,
|
244 |
+
10,
|
245 |
+
"Semantic Search - up to 10 Mar 2024", # Search Source Dropdown component
|
246 |
+
"mistralai/Mixtral-8x7B-Instruct-v0.1", # LLM Model Dropdown component
|
247 |
+
api_name="/update_with_rag_md"
|
248 |
+
)
|
249 |
+
st.code(response1, language="python", *, line_numbers=True, wrap_lines=False)
|
250 |
+
|
251 |
+
|
252 |
+
# ArXiv searcher - Paper Summary & Ask LLM
|
253 |
+
# client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
254 |
|
255 |
response1 = client.predict(
|
256 |
message=query,
|
|
|
280 |
# Save both responses to Cosmos DB
|
281 |
save_to_cosmos_db(query, response1, response2)
|
282 |
|
283 |
+
|
284 |
+
|
285 |
|
286 |
|
287 |
# π Search Glossary function
|