Imsachinsingh00 commited on
Commit
0aef548
·
1 Parent(s): 4cff899

Initial and final commit

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -1,5 +1,7 @@
1
  import streamlit as st
2
  from langchain.llms import HuggingFaceHub
 
 
3
 
4
  st.set_page_config(page_title="Educational Chatbot")
5
 
@@ -11,7 +13,12 @@ if "history" not in st.session_state:
11
  st.session_state.history = []
12
 
13
  if user_input:
14
- llm = HuggingFaceHub(repo_id="tiiuae/falcon-7b-instruct", model_kwargs={"temperature": 0.5, "max_new_tokens": 100})
 
 
 
 
 
15
  response = llm(user_input)
16
  st.session_state.history.append(("You", user_input))
17
  st.session_state.history.append(("Bot", response))
 
1
  import streamlit as st
2
  from langchain.llms import HuggingFaceHub
3
+ import os
4
+ from langchain.llms import HuggingFaceHub
5
 
6
  st.set_page_config(page_title="Educational Chatbot")
7
 
 
13
  st.session_state.history = []
14
 
15
  if user_input:
16
+ llm = HuggingFaceHub(
17
+ repo_id="tiiuae/falcon-7b-instruct",
18
+ huggingfacehub_api_token=os.environ.get("Educational_chatbot"),
19
+ model_kwargs={"temperature": 0.5, "max_new_tokens": 100}
20
+ )
21
+
22
  response = llm(user_input)
23
  st.session_state.history.append(("You", user_input))
24
  st.session_state.history.append(("Bot", response))