67Ayush87 commited on
Commit
8eb7c9e
·
verified ·
1 Parent(s): e9fc0a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -154,12 +154,11 @@ from langchain_community.chat_models import ChatHuggingFace
154
  from langchain_community.llms import HuggingFaceHub
155
  from langchain_core.messages import HumanMessage, SystemMessage
156
 
157
- # # Directly enter or securely load your Hugging Face API token
158
- # HF_TOKEN = "keys" # 🔐 Replace with your token or use st.secrets
159
- # HUGGINGFACEHUB_API_TOKEN = "Keys"
160
- os.environ["HUGGINGFACEHUB_API_TOKEN"] = st.secrets["keys"]
161
 
162
- # Load model with token explicitly passed
163
  llm = HuggingFaceHub(
164
  repo_id="meta-llama/Llama-3.2-3B-Instruct",
165
  huggingfacehub_api_token=HF_TOKEN,
 
154
  from langchain_community.llms import HuggingFaceHub
155
  from langchain_core.messages import HumanMessage, SystemMessage
156
 
157
+ # Set token from Streamlit secrets
158
+ HF_TOKEN = st.secrets["keys"]
159
+ os.environ["HUGGINGFACEHUB_API_TOKEN"] = HF_TOKEN # Optional but okay to set
 
160
 
161
+ # Load the model using the token
162
  llm = HuggingFaceHub(
163
  repo_id="meta-llama/Llama-3.2-3B-Instruct",
164
  huggingfacehub_api_token=HF_TOKEN,