Spaces:
Runtime error
Runtime error
Delete interface.py
Browse files- interface.py +0 -15
interface.py
DELETED
|
@@ -1,15 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import requests
|
| 3 |
-
|
| 4 |
-
API_URL = "https://hadeeratef91-complaint.hf.space/complaints/"
|
| 5 |
-
|
| 6 |
-
def submit_complaint(title, description):
|
| 7 |
-
response = requests.post(API_URL, json={"title": title, "description": description})
|
| 8 |
-
return response.json().get("message", "خطأ في الاتصال بالخادم")
|
| 9 |
-
|
| 10 |
-
def view_complaints():
|
| 11 |
-
response = requests.get(API_URL)
|
| 12 |
-
return "\n".join([f"ID: {item['id']} - {item['title']} ({item['status']})" for item in response.json()])
|
| 13 |
-
|
| 14 |
-
demo = gr.Interface(fn=submit_complaint, inputs=["text", "text"], outputs="text")
|
| 15 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|