Guavacoderepo commited on
Commit
4f46494
·
verified ·
1 Parent(s): 5b2e0a5

Upload 4 files

Browse files
Files changed (4) hide show
  1. README.md +4 -13
  2. app.py +24 -0
  3. readme.md +0 -0
  4. requirements.txt +2 -2
README.md CHANGED
@@ -1,19 +1,10 @@
1
  ---
2
  title: Fin Solve Chatbot
3
- emoji: 🚀
4
- colorFrom: red
5
- colorTo: red
6
  sdk: docker
7
- app_port: 8501
8
- tags:
9
- - streamlit
10
  pinned: false
11
- short_description: Streamlit template space
12
  ---
13
 
14
- # Welcome to Streamlit!
15
-
16
- Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
17
-
18
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
19
- forums](https://discuss.streamlit.io).
 
1
  ---
2
  title: Fin Solve Chatbot
3
+ emoji: 🐠
4
+ colorFrom: green
5
+ colorTo: blue
6
  sdk: docker
 
 
 
7
  pinned: false
 
8
  ---
9
 
10
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from src.pages.auth import login_page, registration_page
3
+ from src.pages.chat import chat_ui
4
+
5
+ if 'is_login' not in st.session_state:
6
+ st.session_state.is_login = True
7
+
8
+ # Initialize session state variables if not already set
9
+ if 'token' not in st.session_state:
10
+ st.session_state.token = None
11
+
12
+ if 'user' not in st.session_state:
13
+ st.session_state.user = {}
14
+
15
+ # Show login page if not authenticated
16
+ if not st.session_state.token:
17
+ if st.session_state.is_login:
18
+ login_page()
19
+ else:
20
+ registration_page()
21
+
22
+ # If user is logged in, show chat interface
23
+ if st.session_state.token:
24
+ chat_ui()
readme.md ADDED
File without changes
requirements.txt CHANGED
@@ -1,3 +1,3 @@
 
1
  altair
2
- pandas
3
- streamlit
 
1
+ streamlit
2
  altair
3
+ pydantic