Spaces:
Runtime error
Runtime error
File size: 662 Bytes
fb49ad8 a168a16 fb49ad8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
from gradio_client import Client
# Function to call the Gradio API
def call_gradio_api(user_input):
client = Client("https://traversaal-internal-rag-faiss-gpt3-5.hf.space/")
result = client.predict(user_input, api_name="/predict")
return result["output1"], result["output2"], result["output3"]
# Interface for the Gradio app
iface = gr.Interface(
fn=call_gradio_api,
inputs=gr.inputs.Textbox(lines=5, label="Input Text"),
outputs=[gr.outputs.Textbox(label="Output 1"),
gr.outputs.Textbox(label="Output 2"),
gr.outputs.Textbox(label="Output 3")]
)
# Launch the Gradio app
iface.launch()
|