Spaces:
Build error
Build error
olegperegudov
commited on
Commit
•
484b4e0
1
Parent(s):
70415b1
add hf token
Browse files- .gitignore +4 -1
- app.py +10 -1
.gitignore
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
1 |
data
|
2 |
env
|
3 |
-
model
|
|
|
|
1 |
+
__pycache__
|
2 |
+
|
3 |
data
|
4 |
env
|
5 |
+
model
|
6 |
+
.env
|
app.py
CHANGED
@@ -1,8 +1,17 @@
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
|
|
|
|
|
|
|
|
3 |
import utils
|
4 |
from build_model import load_model
|
5 |
|
|
|
|
|
|
|
6 |
st.title("Buzzbot")
|
7 |
|
8 |
# Initialize retriever and model
|
@@ -21,7 +30,7 @@ if "messages" not in st.session_state:
|
|
21 |
for message in st.session_state.messages:
|
22 |
with st.chat_message(message["role"]):
|
23 |
st.markdown(message["content"])
|
24 |
-
if message[
|
25 |
st.caption(message["source_docs"])
|
26 |
|
27 |
# Accept user input
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
import streamlit as st
|
4 |
|
5 |
+
# load environment variables
|
6 |
+
from dotenv import load_dotenv
|
7 |
+
from huggingface_hub import login
|
8 |
+
|
9 |
import utils
|
10 |
from build_model import load_model
|
11 |
|
12 |
+
load_dotenv()
|
13 |
+
login(token=os.getenv("HUGGINGFACE_TOKEN"))
|
14 |
+
|
15 |
st.title("Buzzbot")
|
16 |
|
17 |
# Initialize retriever and model
|
|
|
30 |
for message in st.session_state.messages:
|
31 |
with st.chat_message(message["role"]):
|
32 |
st.markdown(message["content"])
|
33 |
+
if message["role"] == "assistant":
|
34 |
st.caption(message["source_docs"])
|
35 |
|
36 |
# Accept user input
|