Spaces:
Sleeping
Sleeping
Commit
Β·
5f358d0
1
Parent(s):
96d76e6
try turbo
Browse files
app.py
CHANGED
|
@@ -53,8 +53,14 @@ def save_to_file(content, filename):
|
|
| 53 |
|
| 54 |
def transcribe_audio(audio_path):
|
| 55 |
"""Transkripsi audio menggunakan Faster Whisper tanpa koreksi model Hugging Face."""
|
| 56 |
-
segments, _ = model.transcribe(audio_path)
|
| 57 |
-
raw_transcription = " ".join(segment.text for segment in segments)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
return (
|
| 59 |
raw_transcription,
|
| 60 |
save_to_file(raw_transcription, "transcription_large.txt"),
|
|
@@ -122,14 +128,14 @@ with gr.Blocks(
|
|
| 122 |
with gr.Column():
|
| 123 |
audio_input = gr.Audio("microphone", type="filepath", label="ποΈ Rekam Suara")
|
| 124 |
transcribe_button = gr.Button("π§ Transkripsi dengan Whisper Large")
|
|
|
|
|
|
|
| 125 |
transcription_edit_box = gr.Textbox(
|
| 126 |
label="π Hasil Transkripsi (Faster Whisper Large) - Bisa Diedit",
|
| 127 |
lines=3,
|
| 128 |
interactive=True,
|
| 129 |
)
|
| 130 |
update_transcription_button = gr.Button("πΎ Simpan Hasil Edit")
|
| 131 |
-
soap_button = gr.Button("π Buat SOAP")
|
| 132 |
-
tags_button = gr.Button("π·οΈ Deteksi Saran Tags")
|
| 133 |
|
| 134 |
with gr.Column():
|
| 135 |
soap_output = gr.Textbox(label="π Hasil SOAP", lines=10, interactive=False)
|
|
|
|
| 53 |
|
| 54 |
def transcribe_audio(audio_path):
|
| 55 |
"""Transkripsi audio menggunakan Faster Whisper tanpa koreksi model Hugging Face."""
|
| 56 |
+
# segments, _ = model.transcribe(audio_path)
|
| 57 |
+
# raw_transcription = " ".join(segment.text for segment in segments)
|
| 58 |
+
raw_transcription = gclient.audio.transcriptions.create(
|
| 59 |
+
file=(audio_path, audio_path.read()),
|
| 60 |
+
model="whisper-large-v3-turbo",
|
| 61 |
+
language="id",
|
| 62 |
+
)
|
| 63 |
+
print(raw_transcription)
|
| 64 |
return (
|
| 65 |
raw_transcription,
|
| 66 |
save_to_file(raw_transcription, "transcription_large.txt"),
|
|
|
|
| 128 |
with gr.Column():
|
| 129 |
audio_input = gr.Audio("microphone", type="filepath", label="ποΈ Rekam Suara")
|
| 130 |
transcribe_button = gr.Button("π§ Transkripsi dengan Whisper Large")
|
| 131 |
+
soap_button = gr.Button("π Buat SOAP")
|
| 132 |
+
tags_button = gr.Button("π·οΈ Deteksi Saran Tags")
|
| 133 |
transcription_edit_box = gr.Textbox(
|
| 134 |
label="π Hasil Transkripsi (Faster Whisper Large) - Bisa Diedit",
|
| 135 |
lines=3,
|
| 136 |
interactive=True,
|
| 137 |
)
|
| 138 |
update_transcription_button = gr.Button("πΎ Simpan Hasil Edit")
|
|
|
|
|
|
|
| 139 |
|
| 140 |
with gr.Column():
|
| 141 |
soap_output = gr.Textbox(label="π Hasil SOAP", lines=10, interactive=False)
|