vericudebuget commited on
Commit
5c4b237
·
verified ·
1 Parent(s): 883c585

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import requests
3
+
4
+ def send_message(message, ip):
5
+ url = f"http://{ip}:8000/receive"
6
+ response = requests.post(url, json={"message": message})
7
+ return response.text
8
+
9
+ iface = gr.Interface(
10
+ fn=send_message,
11
+ inputs=["text", "text"],
12
+ outputs="text",
13
+ title="Message Sender",
14
+ description="Send messages to a specified public IP."
15
+ )
16
+
17
+ iface.launch()