Spaces:
Runtime error
Runtime error
import gradio as gr | |
from LLMwithvoice import gradio_interface | |
# Create the Gradio interface | |
iface = gr.Interface( | |
fn=gradio_interface, | |
inputs=[ | |
gr.Textbox(type="password", lines=1, label="Hugging Face API Token", placeholder="Enter your Hugging Face API token here..."), | |
gr.Textbox(lines=2, label="Context", placeholder="Enter the context here..."), | |
gr.Textbox(lines=1, label="Question", placeholder="Enter your question here...") | |
], | |
outputs=[ | |
gr.Textbox(label="Answer"), | |
gr.Audio(label="Answer as Speech") | |
], | |
title="Chat with Roberta with Voice", | |
description="Ask questions based on a provided context using the Roberta model and hear the response via text-to-speech." | |
) | |
# Launch the Gradio app | |
iface.launch() |