Iliyasss commited on
Commit
1d0b1d6
·
1 Parent(s): 6c4de3b

translation3

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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 = "REMOVED"
 
 
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")