sohailq commited on
Commit
553c9a8
1 Parent(s): f55cba4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,9 +1,13 @@
1
 
2
  import gradio as gr
3
  from transformers import pipeline
 
 
4
 
5
  # Load the English to Urdu translation model from the transformers library
6
- model_name_or_path = "samiulhaq/iwslt-bt-en-ur"
 
 
7
  translator = pipeline("translation", model=model_name_or_path, tokenizer=model_name_or_path)
8
 
9
  # Create a Gradio interface for the translation app
 
1
 
2
  import gradio as gr
3
  from transformers import pipeline
4
+ from fairseq.models.transformer import TransformerModel
5
+
6
 
7
  # Load the English to Urdu translation model from the transformers library
8
+ #model_name_or_path = "samiulhaq/iwslt-bt-en-ur"
9
+ model_name_or_path = TransformerModel.from_pretrained('samiulhaq/iwslt-bt-en-ur')
10
+
11
  translator = pipeline("translation", model=model_name_or_path, tokenizer=model_name_or_path)
12
 
13
  # Create a Gradio interface for the translation app