Spaces:
Sleeping
Sleeping
Commit
Β·
cbb622b
1
Parent(s):
b3b9f17
Initial and final commit
Browse files- app.py +4 -3
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
import os
|
3 |
-
from
|
4 |
|
5 |
st.set_page_config(page_title="Educational Chatbot")
|
6 |
st.title("π Educational Chatbot")
|
@@ -12,10 +12,11 @@ if "history" not in st.session_state:
|
|
12 |
|
13 |
if user_input:
|
14 |
try:
|
15 |
-
llm =
|
16 |
repo_id="tiiuae/falcon-7b-instruct",
|
17 |
huggingfacehub_api_token=os.environ.get("HUGGINGFACEHUB_API_TOKEN"),
|
18 |
-
|
|
|
19 |
)
|
20 |
response = llm.invoke(user_input)
|
21 |
st.session_state.history.append(("You", user_input))
|
|
|
1 |
import streamlit as st
|
2 |
import os
|
3 |
+
from langchain_huggingface import HuggingFaceEndpoint
|
4 |
|
5 |
st.set_page_config(page_title="Educational Chatbot")
|
6 |
st.title("π Educational Chatbot")
|
|
|
12 |
|
13 |
if user_input:
|
14 |
try:
|
15 |
+
llm = HuggingFaceEndpoint(
|
16 |
repo_id="tiiuae/falcon-7b-instruct",
|
17 |
huggingfacehub_api_token=os.environ.get("HUGGINGFACEHUB_API_TOKEN"),
|
18 |
+
temperature=0.5,
|
19 |
+
max_new_tokens=100,
|
20 |
)
|
21 |
response = llm.invoke(user_input)
|
22 |
st.session_state.history.append(("You", user_input))
|
requirements.txt
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
streamlit
|
2 |
langchain
|
3 |
langchain-community
|
|
|
4 |
huggingface_hub
|
5 |
python-dotenv
|
|
|
1 |
streamlit
|
2 |
langchain
|
3 |
langchain-community
|
4 |
+
langchain-huggingface
|
5 |
huggingface_hub
|
6 |
python-dotenv
|