Spaces:
Running
Running
Commit ·
8f87655
1
Parent(s): 3f9d7b5
Cleanup: Remove unwanted files, unused code, and update deployment config
Browse files- .gitignore +12 -0
- Dockerfile +6 -2
- app.py +1 -2
- ollama_integration.py +0 -6
- requirements.txt +6 -3
- src/streamlit_app.py +0 -40
- utils.py +0 -1
.gitignore
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
*.pyc
|
| 3 |
+
.streamlit/
|
| 4 |
+
session.json
|
| 5 |
+
chat_history.json
|
| 6 |
+
BankBot_Accuracy_Document.docx
|
| 7 |
+
generate_accuracy.py
|
| 8 |
+
src/
|
| 9 |
+
.env
|
| 10 |
+
.venv
|
| 11 |
+
venv/
|
| 12 |
+
env/
|
Dockerfile
CHANGED
|
@@ -9,7 +9,11 @@ RUN apt-get update && apt-get install -y \
|
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
COPY requirements.txt ./
|
| 12 |
-
COPY
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
RUN pip3 install -r requirements.txt
|
| 15 |
|
|
@@ -17,4 +21,4 @@ EXPOSE 8501
|
|
| 17 |
|
| 18 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 19 |
|
| 20 |
-
ENTRYPOINT ["streamlit", "run", "
|
|
|
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
COPY requirements.txt ./
|
| 12 |
+
COPY app.py ./
|
| 13 |
+
COPY utils.py ./
|
| 14 |
+
COPY ollama_integration.py ./
|
| 15 |
+
COPY users.json ./
|
| 16 |
+
COPY data/ ./data/
|
| 17 |
|
| 18 |
RUN pip3 install -r requirements.txt
|
| 19 |
|
|
|
|
| 21 |
|
| 22 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 23 |
|
| 24 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
app.py
CHANGED
|
@@ -23,7 +23,6 @@ from utils import (
|
|
| 23 |
get_active_backend,
|
| 24 |
get_all_chat_sessions,
|
| 25 |
get_faq_response,
|
| 26 |
-
rewrite_banking_response,
|
| 27 |
is_banking_query
|
| 28 |
)
|
| 29 |
|
|
@@ -575,7 +574,7 @@ def show_dashboard():
|
|
| 575 |
st.session_state.current_tab = "Dashboard"
|
| 576 |
st.rerun()
|
| 577 |
|
| 578 |
-
if st.button("
|
| 579 |
st.session_state.current_tab = "Banking Assistant"
|
| 580 |
st.rerun()
|
| 581 |
|
|
|
|
| 23 |
get_active_backend,
|
| 24 |
get_all_chat_sessions,
|
| 25 |
get_faq_response,
|
|
|
|
| 26 |
is_banking_query
|
| 27 |
)
|
| 28 |
|
|
|
|
| 574 |
st.session_state.current_tab = "Dashboard"
|
| 575 |
st.rerun()
|
| 576 |
|
| 577 |
+
if st.button(" Banking Assistant", use_container_width=True, type=nav_btn_style2):
|
| 578 |
st.session_state.current_tab = "Banking Assistant"
|
| 579 |
st.rerun()
|
| 580 |
|
ollama_integration.py
CHANGED
|
@@ -193,9 +193,3 @@ def check_ollama_connection():
|
|
| 193 |
return response.status_code == 200
|
| 194 |
except:
|
| 195 |
return False
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
def rewrite_banking_response(predefined_answer):
|
| 199 |
-
"""Uses the active AI backend to rewrite a predefined FAQ response."""
|
| 200 |
-
prompt = f"Rewrite this banking answer to be complete and detailed according to all formal rules:\n\n{predefined_answer}"
|
| 201 |
-
return get_ai_response(prompt)
|
|
|
|
| 193 |
return response.status_code == 200
|
| 194 |
except:
|
| 195 |
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
-
streamlit
|
| 2 |
-
pandas
|
| 3 |
-
numpy
|
| 4 |
plotly
|
|
|
|
| 5 |
groq
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit==1.54.0
|
| 2 |
+
pandas==2.3.3
|
| 3 |
+
numpy==2.4.2
|
| 4 |
plotly
|
| 5 |
+
requests
|
| 6 |
groq
|
| 7 |
+
pillow
|
| 8 |
+
watchdog
|
src/streamlit_app.py
DELETED
|
@@ -1,40 +0,0 @@
|
|
| 1 |
-
import altair as alt
|
| 2 |
-
import numpy as np
|
| 3 |
-
import pandas as pd
|
| 4 |
-
import streamlit as st
|
| 5 |
-
|
| 6 |
-
"""
|
| 7 |
-
# Welcome to Streamlit!
|
| 8 |
-
|
| 9 |
-
Edit `/streamlit_app.py` to customize this app to your heart's desire :heart:.
|
| 10 |
-
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
|
| 11 |
-
forums](https://discuss.streamlit.io).
|
| 12 |
-
|
| 13 |
-
In the meantime, below is an example of what you can do with just a few lines of code:
|
| 14 |
-
"""
|
| 15 |
-
|
| 16 |
-
num_points = st.slider("Number of points in spiral", 1, 10000, 1100)
|
| 17 |
-
num_turns = st.slider("Number of turns in spiral", 1, 300, 31)
|
| 18 |
-
|
| 19 |
-
indices = np.linspace(0, 1, num_points)
|
| 20 |
-
theta = 2 * np.pi * num_turns * indices
|
| 21 |
-
radius = indices
|
| 22 |
-
|
| 23 |
-
x = radius * np.cos(theta)
|
| 24 |
-
y = radius * np.sin(theta)
|
| 25 |
-
|
| 26 |
-
df = pd.DataFrame({
|
| 27 |
-
"x": x,
|
| 28 |
-
"y": y,
|
| 29 |
-
"idx": indices,
|
| 30 |
-
"rand": np.random.randn(num_points),
|
| 31 |
-
})
|
| 32 |
-
|
| 33 |
-
st.altair_chart(alt.Chart(df, height=700, width=700)
|
| 34 |
-
.mark_point(filled=True)
|
| 35 |
-
.encode(
|
| 36 |
-
x=alt.X("x", axis=None),
|
| 37 |
-
y=alt.Y("y", axis=None),
|
| 38 |
-
color=alt.Color("idx", legend=None, scale=alt.Scale()),
|
| 39 |
-
size=alt.Size("rand", legend=None, scale=alt.Scale(range=[1, 150])),
|
| 40 |
-
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
utils.py
CHANGED
|
@@ -12,7 +12,6 @@ from ollama_integration import (
|
|
| 12 |
get_ai_response,
|
| 13 |
stream_ai_response,
|
| 14 |
get_active_backend,
|
| 15 |
-
rewrite_banking_response,
|
| 16 |
is_banking_query
|
| 17 |
)
|
| 18 |
|
|
|
|
| 12 |
get_ai_response,
|
| 13 |
stream_ai_response,
|
| 14 |
get_active_backend,
|
|
|
|
| 15 |
is_banking_query
|
| 16 |
)
|
| 17 |
|