Gordonkl commited on
Commit
5d83894
·
verified ·
1 Parent(s): 2952395

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -25
app.py DELETED
@@ -1,25 +0,0 @@
1
- import gradio as gr
2
- import requests
3
-
4
- # API调用函数
5
- def call_api(user_input):
6
- url = "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-dev" # 替换为你的API URL
7
- headers = {"Authorization": "Bearer YOUR_TOKEN"}
8
- params = {"query": user_input}
9
-
10
- response = requests.get(url, headers=headers, params=params)
11
- if response.status_code == 200:
12
- return response.json() # 返回API的响应
13
- else:
14
- return f"Error: {response.status_code}"
15
-
16
- # 使用Gradio界面
17
- iface = gr.Interface(
18
- fn=call_api,
19
- inputs="text",
20
- outputs="json",
21
- title="API 调用",
22
- description="输入文本并从API获取结果"
23
- )
24
-
25
- iface.launch()