Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,21 +1,21 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import whisper
|
| 3 |
-
import base64
|
| 4 |
-
|
| 5 |
-
# Whisper ๋ชจ๋ธ ๋ก๋
|
| 6 |
-
model = whisper.
|
| 7 |
-
|
| 8 |
-
# ์์ฑ์ ํ
์คํธ๋ก ๋ณํํ๋ ํจ์
|
| 9 |
-
def transcribe_audio(audio):
|
| 10 |
-
result = model.transcribe(audio)
|
| 11 |
-
return result["text"], base64.b64encode(result["text"].encode()).decode() #type: ignore
|
| 12 |
-
|
| 13 |
-
# Gradio ์ธํฐํ์ด์ค
|
| 14 |
-
demo = gr.Interface(fn=transcribe_audio,
|
| 15 |
-
inputs=gr.Audio(label = '์ค๋์ค', sources="microphone", type="filepath"),
|
| 16 |
-
outputs=[gr.Textbox(label='๊ฒฐ๊ณผ'), gr.Textbox(label='์ํธํ๋ ๊ฒฐ๊ณผ')],
|
| 17 |
-
title='์ด์ฐ์ง์ Speech to Text',
|
| 18 |
-
description='AI 60%, ๋ 40% (AI ์ฝ๋ 40๋ถ๋์ ๊ณ ์น๋ค๊ฐ new chat์ผ๋ก ๋ค์ ์ง๋๊น ๋ฐ๋ก๋จ) (Interface๋ ๋ด๊ฐ๋ง๋ฌ) (์ ์์๊ฐ 1์๊ฐ)')
|
| 19 |
-
|
| 20 |
-
# ์ฑ ์คํ
|
| 21 |
-
demo.launch(share=True, auth=('๊ฒฝ์ง์จ๋ฐ', '123456'))
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import whisper
|
| 3 |
+
import base64
|
| 4 |
+
|
| 5 |
+
# Whisper ๋ชจ๋ธ ๋ก๋
|
| 6 |
+
model = whisper.load("base")
|
| 7 |
+
|
| 8 |
+
# ์์ฑ์ ํ
์คํธ๋ก ๋ณํํ๋ ํจ์
|
| 9 |
+
def transcribe_audio(audio):
|
| 10 |
+
result = model.transcribe(audio)
|
| 11 |
+
return result["text"], base64.b64encode(result["text"].encode()).decode() #type: ignore
|
| 12 |
+
|
| 13 |
+
# Gradio ์ธํฐํ์ด์ค
|
| 14 |
+
demo = gr.Interface(fn=transcribe_audio,
|
| 15 |
+
inputs=gr.Audio(label = '์ค๋์ค', sources="microphone", type="filepath"),
|
| 16 |
+
outputs=[gr.Textbox(label='๊ฒฐ๊ณผ'), gr.Textbox(label='์ํธํ๋ ๊ฒฐ๊ณผ')],
|
| 17 |
+
title='์ด์ฐ์ง์ Speech to Text',
|
| 18 |
+
description='AI 60%, ๋ 40% (AI ์ฝ๋ 40๋ถ๋์ ๊ณ ์น๋ค๊ฐ new chat์ผ๋ก ๋ค์ ์ง๋๊น ๋ฐ๋ก๋จ) (Interface๋ ๋ด๊ฐ๋ง๋ฌ) (์ ์์๊ฐ 1์๊ฐ)')
|
| 19 |
+
|
| 20 |
+
# ์ฑ ์คํ
|
| 21 |
+
demo.launch(share=True, auth=('๊ฒฝ์ง์จ๋ฐ', '123456'))
|