Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,12 +14,12 @@ print(f"[SYSTEM] | Using {DEVICE} type compute device.")
|
|
14 |
# Variables
|
15 |
BATCH_SIZE = 8
|
16 |
|
17 |
-
|
18 |
|
19 |
@spaces.GPU
|
20 |
def transcribe(inputs, task):
|
21 |
if inputs is None: raise gr.Error("Invalid input.")
|
22 |
-
output =
|
23 |
return output
|
24 |
|
25 |
def cloud():
|
|
|
14 |
# Variables
|
15 |
BATCH_SIZE = 8
|
16 |
|
17 |
+
repo = pipeline(task="automatic-speech-recognition", model="openai/whisper-large-v3-turbo", chunk_length_s=30, device=DEVICE)
|
18 |
|
19 |
@spaces.GPU
|
20 |
def transcribe(inputs, task):
|
21 |
if inputs is None: raise gr.Error("Invalid input.")
|
22 |
+
output = repo(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)["text"]
|
23 |
return output
|
24 |
|
25 |
def cloud():
|