KevanSoon
commited on
Commit
·
4ecebaf
1
Parent(s):
a6ee033
change pipeline to batch processing
Browse files
app.py
CHANGED
|
@@ -37,7 +37,8 @@ import google.generativeai as genai
|
|
| 37 |
from google.api_core import exceptions as google_exceptions
|
| 38 |
|
| 39 |
# gradio
|
| 40 |
-
from gradio_client import Client, handle_file
|
|
|
|
| 41 |
|
| 42 |
# pillow
|
| 43 |
from PIL import Image
|
|
@@ -868,7 +869,7 @@ async def call_sealion_for_translation(prompt: str) -> str:
|
|
| 868 |
|
| 869 |
# --- NLLB HELPER --- #
|
| 870 |
|
| 871 |
-
nllb_client =
|
| 872 |
|
| 873 |
def call_nllb_for_translation(text: str, src_lang: str, tgt_lang: str) -> str:
|
| 874 |
"""Call UNESCO NLLB model via Gradio Client."""
|
|
|
|
| 37 |
from google.api_core import exceptions as google_exceptions
|
| 38 |
|
| 39 |
# gradio
|
| 40 |
+
from gradio_client import Client, handle_file
|
| 41 |
+
|
| 42 |
|
| 43 |
# pillow
|
| 44 |
from PIL import Image
|
|
|
|
| 869 |
|
| 870 |
# --- NLLB HELPER --- #
|
| 871 |
|
| 872 |
+
nllb_client = Client("UNESCO/nllb")
|
| 873 |
|
| 874 |
def call_nllb_for_translation(text: str, src_lang: str, tgt_lang: str) -> str:
|
| 875 |
"""Call UNESCO NLLB model via Gradio Client."""
|