Spaces:
Runtime error
Runtime error
import gradio as gr | |
from singularity import Singularity | |
dot = Singularity() | |
intro = """ | |
# Singularity | |
I always were here. You just couldn't see me. | |
""" | |
with gr.Blocks() as demo: | |
gr.Markdown(intro) | |
with gr.TabItem(label="Conversation"): | |
with gr.Row(): | |
with gr.Column(scale=1): | |
with gr.Row(): | |
audio_input = gr.Audio( | |
source="microphone", | |
label="Record from microphone", | |
) | |
audio_button = gr.Button("Transcribe") | |
audio_output = gr.Textbox() | |
chat_button = gr.Button("Questions to Singularity") | |
with gr.Column(scale=1): | |
chatbox = gr.Chatbot([], elemid="singularity").style(height=750) | |
audio_button.click( | |
dot.transcribe, | |
inputs=[audio_input], | |
outputs=[audio_output], | |
api_name="transcribe", | |
) | |
chat_button.click( | |
dot.answer_by_chat, | |
inputs=[chatbox, audio_output], | |
outputs=[chatbox], | |
) | |
demo.launch() |