Spaces:
Runtime error
Runtime error
import gradio as gr | |
import os | |
import gradio as gr | |
from gradio import ChatInterface | |
import time | |
def echo(text, text2, request: gr.Request): | |
if request: | |
print("Request headers dictionary:", request.headers) | |
print("IP address:", request.client.host) | |
print("Query parameters:", dict(request.query_params)) | |
print(text,text2) | |
return text+text2 | |
# Define the inputs and outputs for your interface | |
inputs = [ | |
gr.inputs.Textbox(lines=2, placeholder="Enter your message here..."), | |
gr.inputs.Textbox(lines=2, placeholder="Enter additional parameter here...") | |
] | |
outputs = gr.outputs.Textbox() | |
# Create the interface | |
interface = gr.Interface(fn=echo, inputs=inputs, outputs=outputs) | |
# Launch the interface | |
interface.launch() |