Spaces:
Runtime error
Runtime error
Commit
·
536f202
1
Parent(s):
ee73143
Update app.py
Browse files
app.py
CHANGED
@@ -11,9 +11,10 @@ def download():
|
|
11 |
hf_arch, hf_config, hf_tokenizer, hf_model = BLURR.get_hf_objects(pretrained_model_name, model_cls=model_cls)
|
12 |
|
13 |
model = load_learner(hf_hub_download("kurianbenoy/kde_en_ml_translation_model", "saved_model.pkl"))
|
|
|
14 |
|
15 |
def translate_text(text):
|
16 |
-
download()
|
17 |
outputs = model.blurr_translate(text)
|
18 |
return outputs[0]["translation_texts"]
|
19 |
|
|
|
11 |
hf_arch, hf_config, hf_tokenizer, hf_model = BLURR.get_hf_objects(pretrained_model_name, model_cls=model_cls)
|
12 |
|
13 |
model = load_learner(hf_hub_download("kurianbenoy/kde_en_ml_translation_model", "saved_model.pkl"))
|
14 |
+
return model
|
15 |
|
16 |
def translate_text(text):
|
17 |
+
model = download()
|
18 |
outputs = model.blurr_translate(text)
|
19 |
return outputs[0]["translation_texts"]
|
20 |
|