import gradio as gr import whisper import base64 # Whisper 모델 로드 model = whisper.load_model("base") # 음성을 텍스트로 변환하는 함수 def transcribe_audio(audio): result = model.transcribe(audio) return result["text"], base64.b64encode(result["text"].encode()).decode() #type: ignore # Gradio 인터페이스 demo = gr.Interface(fn=transcribe_audio, inputs=gr.Audio(label = '오디오', sources="microphone", type="filepath"), outputs=[gr.Textbox(label='결과'), gr.Textbox(label='암호화된 결과')], title='이우진의 Speech to Text', description='AI 60%, 나 40% (AI 코드 40분동안 고치다가 new chat으로 다시 짜니까 바로됨) (Interface는 내가만듬) (제작시간 1시간)') # 앱 실행 demo.launch(share=True, auth=('경진씨반', '123456'))