Songyou commited on
Commit
95e9a58
·
verified ·
1 Parent(s): cb29da6

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +0 -16
main.py CHANGED
@@ -51,19 +51,3 @@ def api_request(url: str, request_type: str, json_data: str = None):
51
  except Exception as e:
52
  return str(e)
53
 
54
- # 创建Gradio界面
55
- iface = gr.Interface(
56
- fn=api_request,
57
- inputs=[
58
- gr.Textbox(label="URL", placeholder="Enter the URL to send request to"),
59
- gr.Radio(["GET", "POST"], label="Request Type"),
60
- gr.Textbox(label="POST JSON Data (only for POST)", placeholder="Enter JSON data, e.g. {'content': 'Hello'}", visible=False)
61
- ],
62
- outputs="json",
63
- live=True
64
- )
65
-
66
- # 启动FastAPI应用
67
- @app.on_event("startup")
68
- async def startup():
69
- iface.queue().launch(share=True) # 启动Gradio界面,并共享链接
 
51
  except Exception as e:
52
  return str(e)
53