Spaces:
Sleeping
Sleeping
Added HUGGINGFACE_TOKEN to authenticate
Browse files
app.py
CHANGED
|
@@ -1,6 +1,11 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 3 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Load the tokenizer and model from Hugging Face
|
| 6 |
@st.cache_resource
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 3 |
import torch
|
| 4 |
+
from huggingface_hub import login
|
| 5 |
+
|
| 6 |
+
# Authenticate with Hugging Face using the environment variable
|
| 7 |
+
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
| 8 |
+
login(token=huggingface_token)
|
| 9 |
|
| 10 |
# Load the tokenizer and model from Hugging Face
|
| 11 |
@st.cache_resource
|