Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,28 +1,31 @@
|
|
1 |
import os
|
2 |
from embedchain import App
|
3 |
import streamlit as st
|
|
|
4 |
|
5 |
-
with st.sidebar:
|
6 |
-
huggingface_access_token = st.text_input("Hugging face Token", key="chatbot_api_key", type="password")
|
7 |
-
"[Get Hugging Face Access Token](https://huggingface.co/settings/tokens)"
|
8 |
-
"[View the source code](https://github.com/embedchain/examples/mistral-streamlit)"
|
9 |
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
23 |
}
|
24 |
-
|
25 |
-
}
|
26 |
|
27 |
|
28 |
st.title("💬 Chatbot")
|
@@ -43,12 +46,12 @@ for message in st.session_state.messages:
|
|
43 |
with st.chat_message(message["role"]):
|
44 |
st.markdown(message["content"])
|
45 |
|
46 |
-
if prompt := st.chat_input("Ask me anything!"):
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
|
51 |
-
|
52 |
app = App.from_config(config = config)
|
53 |
app.add("https://en.wikipedia.org/wiki/Indian_Premier_League")
|
54 |
|
|
|
1 |
import os
|
2 |
from embedchain import App
|
3 |
import streamlit as st
|
4 |
+
import ollama
|
5 |
|
6 |
+
#with st.sidebar:
|
7 |
+
#huggingface_access_token = st.text_input("Hugging face Token", key="chatbot_api_key", type="password")
|
8 |
+
#"[Get Hugging Face Access Token](https://huggingface.co/settings/tokens)"
|
9 |
+
#"[View the source code](https://github.com/embedchain/examples/mistral-streamlit)"
|
10 |
|
11 |
|
12 |
+
app = App.from_config(config={
|
13 |
+
"llm": {
|
14 |
+
"provider": "ollama",
|
15 |
+
"config": {
|
16 |
+
"model": "llama2",
|
17 |
+
"temperature": 0.5,
|
18 |
+
"top_p": 1,
|
19 |
+
"stream": True
|
20 |
+
}
|
21 |
+
},
|
22 |
+
"embedder": {
|
23 |
+
"provider": "huggingface",
|
24 |
+
"config": {
|
25 |
+
"model": "BAAI/bge-small-en-v1.5"
|
26 |
+
}
|
27 |
}
|
28 |
+
})
|
|
|
29 |
|
30 |
|
31 |
st.title("💬 Chatbot")
|
|
|
46 |
with st.chat_message(message["role"]):
|
47 |
st.markdown(message["content"])
|
48 |
|
49 |
+
#if prompt := st.chat_input("Ask me anything!"):
|
50 |
+
# if not st.session_state.chatbot_api_key:
|
51 |
+
# st.error("Please enter your Hugging Face Access Token")
|
52 |
+
# st.stop()
|
53 |
|
54 |
+
# os.environ["HUGGINGFACE_ACCESS_TOKEN"] = st.session_state.chatbot_api_key
|
55 |
app = App.from_config(config = config)
|
56 |
app.add("https://en.wikipedia.org/wiki/Indian_Premier_League")
|
57 |
|