Spaces:
Runtime error
Runtime error
Synced repo using 'sync_with_huggingface' Github Action
Browse files
chat.py
CHANGED
|
@@ -313,7 +313,8 @@ def chat_page():
|
|
| 313 |
key="b_tool_files",
|
| 314 |
format_func=lambda x: x["file_name"],
|
| 315 |
)
|
| 316 |
-
st.text_input(
|
|
|
|
| 317 |
st.text_input(
|
| 318 |
"Tool Description",
|
| 319 |
"Searches among user's private files and returns related documents",
|
|
@@ -359,14 +360,16 @@ def chat_page():
|
|
| 359 |
)
|
| 360 |
st.markdown("### Uploaded Files")
|
| 361 |
st.dataframe(
|
| 362 |
-
st.session_state.private_kb.list_files(
|
|
|
|
| 363 |
use_container_width=True,
|
| 364 |
)
|
| 365 |
col_1, col_2 = st.columns(2)
|
| 366 |
with col_1:
|
| 367 |
st.button("Add Files", on_click=add_file)
|
| 368 |
with col_2:
|
| 369 |
-
st.button("Clear Files and All Tools",
|
|
|
|
| 370 |
|
| 371 |
st.button("Clear Chat History", on_click=clear_history)
|
| 372 |
st.button("Logout", on_click=back_to_main)
|
|
|
|
| 313 |
key="b_tool_files",
|
| 314 |
format_func=lambda x: x["file_name"],
|
| 315 |
)
|
| 316 |
+
st.text_input(
|
| 317 |
+
"Tool Name", "get_relevant_documents", key="b_tool_name")
|
| 318 |
st.text_input(
|
| 319 |
"Tool Description",
|
| 320 |
"Searches among user's private files and returns related documents",
|
|
|
|
| 360 |
)
|
| 361 |
st.markdown("### Uploaded Files")
|
| 362 |
st.dataframe(
|
| 363 |
+
st.session_state.private_kb.list_files(
|
| 364 |
+
st.session_state.user_name),
|
| 365 |
use_container_width=True,
|
| 366 |
)
|
| 367 |
col_1, col_2 = st.columns(2)
|
| 368 |
with col_1:
|
| 369 |
st.button("Add Files", on_click=add_file)
|
| 370 |
with col_2:
|
| 371 |
+
st.button("Clear Files and All Tools",
|
| 372 |
+
on_click=clear_files)
|
| 373 |
|
| 374 |
st.button("Clear Chat History", on_click=clear_history)
|
| 375 |
st.button("Logout", on_click=back_to_main)
|
login.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
-
import json
|
| 2 |
-
import time
|
| 3 |
import pandas as pd
|
| 4 |
from os import environ
|
| 5 |
import streamlit as st
|
|
@@ -8,14 +6,18 @@ from auth0_component import login_button
|
|
| 8 |
AUTH0_CLIENT_ID = st.secrets['AUTH0_CLIENT_ID']
|
| 9 |
AUTH0_DOMAIN = st.secrets['AUTH0_DOMAIN']
|
| 10 |
|
|
|
|
| 11 |
def login():
|
| 12 |
if "user_name" in st.session_state or ("jump_query_ask" in st.session_state and st.session_state.jump_query_ask):
|
| 13 |
return True
|
| 14 |
-
st.subheader(
|
|
|
|
| 15 |
st.write("You can now chat with ArXiv and Wikipedia! π\n")
|
| 16 |
st.write("Built purely with streamlit π , LangChain π¦π and love β€οΈ for AI!")
|
| 17 |
-
st.write(
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
st.divider()
|
| 20 |
col1, col2 = st.columns(2, gap='large')
|
| 21 |
with col1.container():
|
|
@@ -33,7 +35,7 @@ def login():
|
|
| 33 |
st.write("- [Privacy Policy](https://myscale.com/privacy/)\n"
|
| 34 |
"- [Terms of Sevice](https://myscale.com/terms/)")
|
| 35 |
if st.session_state.auth0 is not None:
|
| 36 |
-
st.session_state.user_info = dict(st.session_state.auth0)
|
| 37 |
if 'email' in st.session_state.user_info:
|
| 38 |
email = st.session_state.user_info["email"]
|
| 39 |
else:
|
|
@@ -44,6 +46,7 @@ def login():
|
|
| 44 |
if st.session_state.jump_query_ask:
|
| 45 |
st.experimental_rerun()
|
| 46 |
|
|
|
|
| 47 |
def back_to_main():
|
| 48 |
if "user_info" in st.session_state:
|
| 49 |
del st.session_state.user_info
|
|
|
|
|
|
|
|
|
|
| 1 |
import pandas as pd
|
| 2 |
from os import environ
|
| 3 |
import streamlit as st
|
|
|
|
| 6 |
AUTH0_CLIENT_ID = st.secrets['AUTH0_CLIENT_ID']
|
| 7 |
AUTH0_DOMAIN = st.secrets['AUTH0_DOMAIN']
|
| 8 |
|
| 9 |
+
|
| 10 |
def login():
|
| 11 |
if "user_name" in st.session_state or ("jump_query_ask" in st.session_state and st.session_state.jump_query_ask):
|
| 12 |
return True
|
| 13 |
+
st.subheader(
|
| 14 |
+
"π€ Welcom to [MyScale](https://myscale.com)'s [ChatData](https://github.com/myscale/ChatData)! π€ ")
|
| 15 |
st.write("You can now chat with ArXiv and Wikipedia! π\n")
|
| 16 |
st.write("Built purely with streamlit π , LangChain π¦π and love β€οΈ for AI!")
|
| 17 |
+
st.write(
|
| 18 |
+
"Follow us on [Twitter](https://x.com/myscaledb) and [Discord](https://discord.gg/D2qpkqc4Jq)!")
|
| 19 |
+
st.write(
|
| 20 |
+
"For more details, please refer to [our repository on GitHub](https://github.com/myscale/ChatData)!")
|
| 21 |
st.divider()
|
| 22 |
col1, col2 = st.columns(2, gap='large')
|
| 23 |
with col1.container():
|
|
|
|
| 35 |
st.write("- [Privacy Policy](https://myscale.com/privacy/)\n"
|
| 36 |
"- [Terms of Sevice](https://myscale.com/terms/)")
|
| 37 |
if st.session_state.auth0 is not None:
|
| 38 |
+
st.session_state.user_info = dict(st.session_state.auth0)
|
| 39 |
if 'email' in st.session_state.user_info:
|
| 40 |
email = st.session_state.user_info["email"]
|
| 41 |
else:
|
|
|
|
| 46 |
if st.session_state.jump_query_ask:
|
| 47 |
st.experimental_rerun()
|
| 48 |
|
| 49 |
+
|
| 50 |
def back_to_main():
|
| 51 |
if "user_info" in st.session_state:
|
| 52 |
del st.session_state.user_info
|