Imsachinsingh00 commited on
Commit
cbb622b
Β·
1 Parent(s): b3b9f17

Initial and final commit

Browse files
Files changed (2) hide show
  1. app.py +4 -3
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
  import os
3
- from langchain_community.llms import HuggingFaceHub
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 = HuggingFaceHub(
16
  repo_id="tiiuae/falcon-7b-instruct",
17
  huggingfacehub_api_token=os.environ.get("HUGGINGFACEHUB_API_TOKEN"),
18
- model_kwargs={"temperature": 0.5, "max_new_tokens": 100}
 
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