AEUPH commited on
Commit
82f8c83
·
1 Parent(s): f2908d5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # Define a function to interact with the server
4
+ def interact_with_server(prompt):
5
+ # You can replace this URL with the actual URL of your Flask server
6
+ server_url = "http://xzyorb.servemp3.com:80"
7
+
8
+ # Make a POST request to the server
9
+ response = requests.post(server_url, data={"prompt": prompt})
10
+
11
+ # Extract the response text from the server's HTML content
12
+ response_text = extract_response_text(response.content)
13
+
14
+ return response_text
15
+
16
+ # Define the Gradio interface
17
+ iface = gr.Interface(
18
+ fn=interact_with_server,
19
+ inputs=gr.inputs.Textbox(),
20
+ outputs=gr.outputs.HTML()
21
+ )
22
+
23
+ # Launch the Gradio app
24
+ iface.launch()