Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,7 @@ import pylint
|
|
| 10 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 11 |
from transformers import pipeline
|
| 12 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
|
|
|
| 13 |
|
| 14 |
# Define functions for each feature
|
| 15 |
|
|
@@ -255,7 +256,8 @@ if st.button("Launch Chat App"):
|
|
| 255 |
# User Authentication
|
| 256 |
hf_token = st.text_input("Enter your Hugging Face Token:")
|
| 257 |
if hf_token:
|
| 258 |
-
|
|
|
|
| 259 |
|
| 260 |
# Construct the command to launch the chat app
|
| 261 |
command = f"cd projects/{project_name} && streamlit run chat_app.py"
|
|
|
|
| 10 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 11 |
from transformers import pipeline
|
| 12 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
| 13 |
+
from huggingface_hub import cached_download, hf_hub_url, HfFolder
|
| 14 |
|
| 15 |
# Define functions for each feature
|
| 16 |
|
|
|
|
| 256 |
# User Authentication
|
| 257 |
hf_token = st.text_input("Enter your Hugging Face Token:")
|
| 258 |
if hf_token:
|
| 259 |
+
# Set the token using HfFolder
|
| 260 |
+
HfFolder.save_token(hf_token)
|
| 261 |
|
| 262 |
# Construct the command to launch the chat app
|
| 263 |
command = f"cd projects/{project_name} && streamlit run chat_app.py"
|