ChiranthanCV
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -6,15 +6,16 @@ import torch
|
|
6 |
# model="Salesforce/blip-image-captioning-base")
|
7 |
|
8 |
pipe = pipeline(task="translation",
|
9 |
-
model="
|
10 |
torch_dtype=torch.bfloat16)
|
11 |
|
12 |
-
text_translated = pipe(text,
|
13 |
-
|
14 |
-
|
15 |
|
16 |
def launch(input):
|
17 |
-
out = pipe(input
|
|
|
18 |
return out[0]['generated_text']
|
19 |
|
20 |
iface = gr.Interface(launch,
|
|
|
6 |
# model="Salesforce/blip-image-captioning-base")
|
7 |
|
8 |
pipe = pipeline(task="translation",
|
9 |
+
model="facebook/nllb-200-distilled-600M",
|
10 |
torch_dtype=torch.bfloat16)
|
11 |
|
12 |
+
# text_translated = pipe(text,
|
13 |
+
# src_lang="eng_Latn",
|
14 |
+
# tgt_lang="fra_Latn")
|
15 |
|
16 |
def launch(input):
|
17 |
+
out = pipe(input, src_lang="eng_Latn",
|
18 |
+
tgt_lang="fra_Latn")
|
19 |
return out[0]['generated_text']
|
20 |
|
21 |
iface = gr.Interface(launch,
|