커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
7. 음성 인공지능 서비스 개발하기 음성파일 인식 문제
AI가 처음이어도 쉽게 배우는 생성형 AI A to Z
챕터 2
북마크
전*음
댓글
1
추천
0
조회수
3
조회수
3
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.



음성파일의 확장자가 m4a로 되어 있는데 이 파일 확장자가 문제인지 궁금합니다.


작성코드


from transformers import pipeline


import gradio as gr


asr = pipeline("automatic-speech-recognition", "facebook/seamless-m4t-v2-large")


def speech_to_text(speech):

    text = asr(speech)["text"]

    return text



with gr.Blocks() as demo:

    audio_file = gr.Audio(type="filepath")

    text = gr.Textbox()

    label = gr.Label()


    button1 = gr.Button('Recognize Speech')


    button1.click(speech_to_text, inputs=audio_file, outputs=text)


demo.launch(debug=True, share=True)



스파르타 즉문즉답







취소
 공유
취소
댓글 0
댓글 알림
나의얼굴