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

translation2

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -3,6 +3,8 @@ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, TranslationPipeli
3
 
4
  print("Loading the model...")
5
 
 
 
6
  # Title and Description
7
  st.title("Translation Web App")
8
  st.write("""
@@ -15,8 +17,14 @@ Enter text in the source language, select source and target languages, and see t
15
  @st.cache_resource
16
  def load_translation_pipeline():
17
  print("Loading translation model...")
18
- model = AutoModelForSeq2SeqLM.from_pretrained('issai/tilmash')
19
- tokenizer = AutoTokenizer.from_pretrained("issai/tilmash")
 
 
 
 
 
 
20
  return TranslationPipeline(model=model, tokenizer=tokenizer, max_length=1000)
21
 
22
  tilmash = load_translation_pipeline()
 
3
 
4
  print("Loading the model...")
5
 
6
+ hf_token = "REMOVED"
7
+
8
  # Title and Description
9
  st.title("Translation Web App")
10
  st.write("""
 
17
  @st.cache_resource
18
  def load_translation_pipeline():
19
  print("Loading translation model...")
20
+ model = AutoModelForSeq2SeqLM.from_pretrained(
21
+ 'issai/tilmash',
22
+ use_auth_token=hf_token
23
+ )
24
+ tokenizer = AutoTokenizer.from_pretrained(
25
+ "issai/tilmash",
26
+ use_auth_token=hf_token
27
+ )
28
  return TranslationPipeline(model=model, tokenizer=tokenizer, max_length=1000)
29
 
30
  tilmash = load_translation_pipeline()