import gradio as gr #import requests from PIL import Image import os from share_btn import community_icon_html, loading_icon_html, share_js token = os.environ.get('HF_TOKEN') whisper_to_gpt = gr.Blocks.load(name="spaces/fffiloni/whisper-to-chatGPT") tts = gr.Interface.load(name="spaces/Flux9665/IMS-Toucan") talking_face = gr.Blocks.load(name="spaces/fffiloni/one-shot-talking-face", api_key=token) def infer(audio): whisper_to_gpt_response = whisper_to_gpt(audio, "translate", fn_index=0) #print(gpt_response) audio_response = tts(whisper_to_gpt_response[1], "English Text", "English Accent", "English Speaker's Voice", fn_index=0) #image = Image.open(r"wise_woman_portrait.png") portrait_link = talking_face("wise_woman_portrait.png", audio_response, fn_index=0) #portrait_response = requests.get(portrait_link, headers={'Authorization': 'Bearer ' + token}) #print(portrait_response.text) return whisper_to_gpt_response[0], portrait_link, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True) title = """
Use Whisper to ask, alive portrait responds !