awacke1 commited on
Commit
9e23d50
โ€ข
1 Parent(s): 3affc9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -17
app.py CHANGED
@@ -101,30 +101,31 @@ def load_file(file_name):
101
  #)
102
  #st.markdown(result)
103
 
104
- def search_arxiv():
105
  st.title("โ–ถ๏ธ Semantic and Episodic Memory System")
106
 
107
  client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
108
 
109
- search_query = st.text_input("Search")
110
  top_n_results = st.slider("Top n results as context", min_value=4, max_value=100, value=100)
111
  search_source = st.selectbox("Search Source", ["Semantic Search - up to 10 Mar 2024", "Arxiv Search - Latest - (EXPERIMENTAL)"])
112
  llm_model = st.selectbox("LLM Model", ["mistralai/Mixtral-8x7B-Instruct-v0.1", "mistralai/Mistral-7B-Instruct-v0.2", "google/gemma-7b-it", "None"])
113
 
114
- if st.button("๐Ÿ”Ž Search"):
115
- result = client.predict(
116
- search_query,
117
- top_n_results,
118
- search_source,
119
- llm_model,
120
- api_name="/update_with_rag_md"
121
- )
122
- st.markdown(result)
 
123
 
124
- file_type = st.radio("Select Memory Flag", ("Semantic", "Episodic"))
125
- if st.button("Save"):
126
- file_name = save_file(result, file_type)
127
- st.success(f"File saved: {file_name}")
128
 
129
  saved_files = [f for f in os.listdir(".") if f.endswith(".md")]
130
  selected_file = st.sidebar.selectbox("Saved Files", saved_files)
@@ -145,8 +146,6 @@ def search_arxiv():
145
  os.remove(selected_file)
146
  st.warning(f"File deleted: {selected_file}")
147
 
148
-
149
-
150
  # Set page configuration with a title and favicon
151
  st.set_page_config(
152
  page_title="๐Ÿ“–๐Ÿ”Arxiv-Paper-Search-QA-RAG-Streamlit-Gradio-APAI",
 
101
  #)
102
  #st.markdown(result)
103
 
104
+ def search_arxiv(query):
105
  st.title("โ–ถ๏ธ Semantic and Episodic Memory System")
106
 
107
  client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
108
 
109
+ search_query = query
110
  top_n_results = st.slider("Top n results as context", min_value=4, max_value=100, value=100)
111
  search_source = st.selectbox("Search Source", ["Semantic Search - up to 10 Mar 2024", "Arxiv Search - Latest - (EXPERIMENTAL)"])
112
  llm_model = st.selectbox("LLM Model", ["mistralai/Mixtral-8x7B-Instruct-v0.1", "mistralai/Mistral-7B-Instruct-v0.2", "google/gemma-7b-it", "None"])
113
 
114
+ st.markdown('### ๐Ÿ”Ž ' + query
115
+ #if st.button("๐Ÿ”Ž Search"):
116
+ result = client.predict(
117
+ search_query,
118
+ top_n_results,
119
+ search_source,
120
+ llm_model,
121
+ api_name="/update_with_rag_md"
122
+ )
123
+ st.markdown(result)
124
 
125
+ file_type = st.radio("Select Memory Flag", ("Semantic", "Episodic"))
126
+ if st.button("Save"):
127
+ file_name = save_file(result, file_type)
128
+ st.success(f"File saved: {file_name}")
129
 
130
  saved_files = [f for f in os.listdir(".") if f.endswith(".md")]
131
  selected_file = st.sidebar.selectbox("Saved Files", saved_files)
 
146
  os.remove(selected_file)
147
  st.warning(f"File deleted: {selected_file}")
148
 
 
 
149
  # Set page configuration with a title and favicon
150
  st.set_page_config(
151
  page_title="๐Ÿ“–๐Ÿ”Arxiv-Paper-Search-QA-RAG-Streamlit-Gradio-APAI",