Shunfeng Zheng commited on
Commit
3a47676
·
verified ·
1 Parent(s): 8bddd87

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +10 -8
  2. app.py +20 -0
  3. requirements.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Dockerb
3
- emoji: 🦀
4
- colorFrom: pink
5
- colorTo: gray
6
- sdk: docker
 
 
 
7
  pinned: false
8
- ---
9
-
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: SpatialParse_back_copy
3
+ emoji: 🔧
4
+ colorFrom: gray
5
+ colorTo: indigo
6
+ sdk: gradio # 同样需要确认这里是gradio
7
+ sdk_version: 3.50.2
8
+ private: true # Pro版专属选项
9
+ app_file: app.py
10
  pinned: false
11
+ license: mit
12
+ ---
 
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import time # 模拟处理耗时
3
+
4
+ def process_api(input_text):
5
+ # 这里编写实际的后端处理逻辑
6
+ time.sleep(1) # 模拟处理延迟
7
+ return {
8
+ "status": "success",
9
+ "result": f"Processed: {input_text.upper()}",
10
+ "timestamp": time.time()
11
+ }
12
+
13
+ # 设置API格式为JSON
14
+ gr.Interface(
15
+ fn=process_api,
16
+ inputs="text",
17
+ outputs="json",
18
+ title="Backend API",
19
+ allow_flagging="never"
20
+ ).launch()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio