Spaces:
Configuration error
Configuration error
translation3
Browse files
app.py
CHANGED
@@ -1,9 +1,12 @@
|
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, TranslationPipeline
|
3 |
|
4 |
print("Loading the model...")
|
5 |
|
6 |
-
hf_token = "
|
|
|
|
|
7 |
|
8 |
# Title and Description
|
9 |
st.title("Translation Web App")
|
|
|
1 |
+
import os
|
2 |
import streamlit as st
|
3 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, TranslationPipeline
|
4 |
|
5 |
print("Loading the model...")
|
6 |
|
7 |
+
hf_token = os.getenv("HF_AUTH_TOKEN")
|
8 |
+
if not hf_token:
|
9 |
+
raise ValueError("Hugging Face token not found. Please set the HF_AUTH_TOKEN environment variable.")
|
10 |
|
11 |
# Title and Description
|
12 |
st.title("Translation Web App")
|