Shunfeng Zheng commited on
Commit
349fe84
·
verified ·
1 Parent(s): c9c01b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -7,23 +7,23 @@ from spacy import displacy
7
  os.system("python -m spacy download en_core_web_md")
8
 
9
  nlp = spacy.load("en_core_web_md")
10
- # def process_api(input_text):
11
- # # 这里编写实际的后端处理逻辑
12
-
13
- # return {
14
- # "status": "success",
15
- # "result": f"Processed: {input_text.upper()}",
16
- # "timestamp": time.time()
17
- # }
18
-
19
- # # 设置API格式为JSON
20
- # gr.Interface(
21
- # fn=process_api,
22
- # inputs="text",
23
- # outputs="json",
24
- # title="Backend API",
25
- # allow_flagging="never"
26
- # ).launch()
27
 
28
 
29
  # import gradio as gr
 
7
  os.system("python -m spacy download en_core_web_md")
8
 
9
  nlp = spacy.load("en_core_web_md")
10
+ def process_api(input_text):
11
+ # 这里编写实际的后端处理逻辑
12
+
13
+ return {
14
+ "status": "success",
15
+ "result": f"Processed: {input_text.upper()}",
16
+ "timestamp": time.time()
17
+ }
18
+
19
+ # 设置API格式为JSON
20
+ gr.Interface(
21
+ fn=process_api,
22
+ inputs="text",
23
+ outputs="json",
24
+ title="Backend API",
25
+ allow_flagging="never"
26
+ ).launch()
27
 
28
 
29
  # import gradio as gr