Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
#
|
158 |
-
|
159 |
-
|
160 |
-
os.environ["HUGGINGFACEHUB_API_TOKEN"] = st.secrets["keys"]
|
161 |
|
162 |
-
# Load model
|
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,
|