IinjyI commited on
Commit
9f2169b
·
verified ·
1 Parent(s): f379dc8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  import pickle
 
3
 
4
  import pandas as pd
5
  import numpy as np
@@ -19,7 +20,12 @@ nltk.download('stopwords')
19
 
20
  model_checkpoint = "marefa-nlp/marefa-mt-en-ar"
21
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
22
- model = TFAutoModelForSeq2SeqLM.from_pretrained(model_checkpoint,from_pt=True)
 
 
 
 
 
23
 
24
  # Load cleaned_word_embeddings
25
  with open("cleaned_word_embeddings.pkl", "rb") as f:
 
1
  import gradio as gr
2
  import pickle
3
+ import zipfile
4
 
5
  import pandas as pd
6
  import numpy as np
 
20
 
21
  model_checkpoint = "marefa-nlp/marefa-mt-en-ar"
22
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
23
+ #model = TFAutoModelForSeq2SeqLM.from_pretrained(model_checkpoint,from_pt=True)
24
+ with zipfile.ZipFile("tf_model.zip", 'r') as zip_ref:
25
+ zip_ref.extractall("/tfmodel")
26
+
27
+ model = TFAutoModelForSeq2SeqLM.from_pretrained("tf_model/")
28
+
29
 
30
  # Load cleaned_word_embeddings
31
  with open("cleaned_word_embeddings.pkl", "rb") as f: