Spaces:
Running
Running
Update app.py
Browse filesChange model that can understand transcribe Filipino and Cebuano
app.py
CHANGED
@@ -13,7 +13,7 @@ from transformers import WhisperProcessor, WhisperForConditionalGeneration, pipe
|
|
13 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
14 |
|
15 |
# load model and processor
|
16 |
-
model_id = "rbcurzon/whisper-small-
|
17 |
pipe = pipeline("automatic-speech-recognition", model=model_id, device=device)
|
18 |
|
19 |
"""**FastAPI**"""
|
@@ -29,7 +29,7 @@ from google.genai import types
|
|
29 |
client = genai.Client(api_key=os.environ.get("GENAI_API_KEY")) # Do not share api key
|
30 |
|
31 |
def translate(text, srcLang, tgtLang):
|
32 |
-
sys_instruct = "You are a professional translator.
|
33 |
response = client.models.generate_content(
|
34 |
model="gemini-2.0-flash",
|
35 |
config=types.GenerateContentConfig(
|
|
|
13 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
14 |
|
15 |
# load model and processor
|
16 |
+
model_id = "rbcurzon/whisper-small-fil"
|
17 |
pipe = pipeline("automatic-speech-recognition", model=model_id, device=device)
|
18 |
|
19 |
"""**FastAPI**"""
|
|
|
29 |
client = genai.Client(api_key=os.environ.get("GENAI_API_KEY")) # Do not share api key
|
30 |
|
31 |
def translate(text, srcLang, tgtLang):
|
32 |
+
sys_instruct = "You are a professional translator. Do not give explanation."
|
33 |
response = client.models.generate_content(
|
34 |
model="gemini-2.0-flash",
|
35 |
config=types.GenerateContentConfig(
|