Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def transcribe(microphone, file_upload):
|
|
32 |
|
33 |
file = microphone if microphone is not None else file_upload
|
34 |
|
35 |
-
text = pipe(file,
|
36 |
|
37 |
return warn_output + text
|
38 |
|
@@ -52,7 +52,7 @@ def yt_transcribe(yt_url):
|
|
52 |
stream = yt.streams.filter(only_audio=True)[0]
|
53 |
stream.download(filename="audio.mp3")
|
54 |
|
55 |
-
text = pipe("audio.mp3",
|
56 |
|
57 |
return html_embed_str, text
|
58 |
|
|
|
32 |
|
33 |
file = microphone if microphone is not None else file_upload
|
34 |
|
35 |
+
text = pipe(file, return_timestamps=True, generate_kwargs={"language":"<|th|>", "task":"transcribe"}, batch_size=16)["text"]
|
36 |
|
37 |
return warn_output + text
|
38 |
|
|
|
52 |
stream = yt.streams.filter(only_audio=True)[0]
|
53 |
stream.download(filename="audio.mp3")
|
54 |
|
55 |
+
text = pipe("audio.mp3", return_timestamps=True, generate_kwargs={"language":"<|th|>", "task":"transcribe"}, batch_size=16)["text"]
|
56 |
|
57 |
return html_embed_str, text
|
58 |
|