Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,6 +92,44 @@ def SpeechSynthesis(result):
|
|
| 92 |
'''
|
| 93 |
components.html(documentHTML5, width=1280, height=300)
|
| 94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
def parse_to_markdown(text):
|
| 96 |
return text
|
| 97 |
|
|
@@ -587,13 +625,10 @@ def FileSidebar():
|
|
| 587 |
if new_file_content_area != file_contents:
|
| 588 |
st.markdown(new_file_content_area) #changed
|
| 589 |
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
filesearch = PromptPrefix + file_content_area
|
| 593 |
st.markdown(filesearch)
|
| 594 |
-
|
| 595 |
-
if st.button(key=rerun, label='🔍AI Search' ):
|
| 596 |
-
search_glossary(filesearch)
|
| 597 |
|
| 598 |
if next_action=='md':
|
| 599 |
st.markdown(file_contents)
|
|
@@ -628,7 +663,7 @@ def FileSidebar():
|
|
| 628 |
#search_glossary(file_contents)
|
| 629 |
filesearch = PromptPrefix2 + file_content_area
|
| 630 |
st.markdown(filesearch)
|
| 631 |
-
if st.button(key=rerun, label='🔍Re-Code' ):
|
| 632 |
#search_glossary(filesearch)
|
| 633 |
search_arxiv(filesearch)
|
| 634 |
|
|
@@ -723,39 +758,6 @@ def load_score(key):
|
|
| 723 |
return 0
|
| 724 |
|
| 725 |
|
| 726 |
-
# 🔍Search Glossary
|
| 727 |
-
@st.cache_resource
|
| 728 |
-
def search_glossary(query):
|
| 729 |
-
all=""
|
| 730 |
-
st.markdown(f"- {query}")
|
| 731 |
-
|
| 732 |
-
# 🔍Run 1 - ArXiv RAG researcher expert ~-<>-~ Paper Summary & Ask LLM
|
| 733 |
-
client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
| 734 |
-
response2 = client.predict(
|
| 735 |
-
query, # str in 'parameter_13' Textbox component
|
| 736 |
-
#"mistralai/Mixtral-8x7B-Instruct-v0.1", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
| 737 |
-
#"mistralai/Mistral-7B-Instruct-v0.2", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
| 738 |
-
"google/gemma-7b-it", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
| 739 |
-
True, # bool in 'Stream output' Checkbox component
|
| 740 |
-
api_name="/ask_llm"
|
| 741 |
-
)
|
| 742 |
-
st.write('🔍Run of Multi-Agent System Paper Summary Spec is Complete')
|
| 743 |
-
st.markdown(response2)
|
| 744 |
-
|
| 745 |
-
# ArXiv searcher ~-<>-~ Paper References - Update with RAG
|
| 746 |
-
client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
| 747 |
-
response1 = client.predict(
|
| 748 |
-
query,
|
| 749 |
-
10,
|
| 750 |
-
"Semantic Search - up to 10 Mar 2024", # Literal['Semantic Search - up to 10 Mar 2024', 'Arxiv Search - Latest - (EXPERIMENTAL)'] in 'Search Source' Dropdown component
|
| 751 |
-
"mistralai/Mixtral-8x7B-Instruct-v0.1", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
| 752 |
-
api_name="/update_with_rag_md"
|
| 753 |
-
)
|
| 754 |
-
st.write('🔍Run of Multi-Agent System Paper References is Complete')
|
| 755 |
-
responseall = response2 + response1[0] + response1[1]
|
| 756 |
-
st.markdown(responseall)
|
| 757 |
-
return responseall
|
| 758 |
-
|
| 759 |
|
| 760 |
# Function to display the glossary in a structured format
|
| 761 |
def display_glossary(glossary, area):
|
|
|
|
| 92 |
'''
|
| 93 |
components.html(documentHTML5, width=1280, height=300)
|
| 94 |
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
# 🔍Search Glossary
|
| 98 |
+
# @st.cache_resource
|
| 99 |
+
def search_glossary(query):
|
| 100 |
+
all=""
|
| 101 |
+
st.markdown(f"- {query}")
|
| 102 |
+
|
| 103 |
+
# 🔍Run 1 - ArXiv RAG researcher expert ~-<>-~ Paper Summary & Ask LLM
|
| 104 |
+
client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
| 105 |
+
response2 = client.predict(
|
| 106 |
+
query, # str in 'parameter_13' Textbox component
|
| 107 |
+
#"mistralai/Mixtral-8x7B-Instruct-v0.1", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
| 108 |
+
#"mistralai/Mistral-7B-Instruct-v0.2", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
| 109 |
+
"google/gemma-7b-it", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
| 110 |
+
True, # bool in 'Stream output' Checkbox component
|
| 111 |
+
api_name="/ask_llm"
|
| 112 |
+
)
|
| 113 |
+
st.write('🔍Run of Multi-Agent System Paper Summary Spec is Complete')
|
| 114 |
+
st.markdown(response2)
|
| 115 |
+
|
| 116 |
+
# ArXiv searcher ~-<>-~ Paper References - Update with RAG
|
| 117 |
+
client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
| 118 |
+
response1 = client.predict(
|
| 119 |
+
query,
|
| 120 |
+
10,
|
| 121 |
+
"Semantic Search - up to 10 Mar 2024", # Literal['Semantic Search - up to 10 Mar 2024', 'Arxiv Search - Latest - (EXPERIMENTAL)'] in 'Search Source' Dropdown component
|
| 122 |
+
"mistralai/Mixtral-8x7B-Instruct-v0.1", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
| 123 |
+
api_name="/update_with_rag_md"
|
| 124 |
+
)
|
| 125 |
+
st.write('🔍Run of Multi-Agent System Paper References is Complete')
|
| 126 |
+
responseall = response2 + response1[0] + response1[1]
|
| 127 |
+
st.markdown(responseall)
|
| 128 |
+
return responseall
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
|
| 133 |
def parse_to_markdown(text):
|
| 134 |
return text
|
| 135 |
|
|
|
|
| 625 |
if new_file_content_area != file_contents:
|
| 626 |
st.markdown(new_file_content_area) #changed
|
| 627 |
|
| 628 |
+
if next_action=='search':
|
| 629 |
+
filesearch = PromptPrefix + file_contents
|
|
|
|
| 630 |
st.markdown(filesearch)
|
| 631 |
+
search_glossary(filesearch)
|
|
|
|
|
|
|
| 632 |
|
| 633 |
if next_action=='md':
|
| 634 |
st.markdown(file_contents)
|
|
|
|
| 663 |
#search_glossary(file_contents)
|
| 664 |
filesearch = PromptPrefix2 + file_content_area
|
| 665 |
st.markdown(filesearch)
|
| 666 |
+
if st.button(key='rerun', label='🔍Re-Code' ):
|
| 667 |
#search_glossary(filesearch)
|
| 668 |
search_arxiv(filesearch)
|
| 669 |
|
|
|
|
| 758 |
return 0
|
| 759 |
|
| 760 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 761 |
|
| 762 |
# Function to display the glossary in a structured format
|
| 763 |
def display_glossary(glossary, area):
|