Shunfeng Zheng commited on
Commit
e3eb446
·
verified ·
1 Parent(s): 4b6e8f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -22
app.py CHANGED
@@ -1,30 +1,30 @@
1
- import gradio as gr
2
- import time # 模拟处理耗时
3
 
4
- def process_api(input_text):
5
- # 这里编写实际的后端处理逻辑
6
 
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()
21
 
22
 
23
- # import gradio as gr
24
- # import spacy
25
- # from spacy import displacy
26
- # import pandas as pd
27
- # import time
28
 
29
  # nlp = spacy.load("en_core_web_md")
30
  # HTML_WRAPPER = "<div style='padding: 10px;'>{}</div>"
 
1
+ # import gradio as gr
2
+ # import time # 模拟处理耗时
3
 
4
+ # def process_api(input_text):
5
+ # # 这里编写实际的后端处理逻辑
6
 
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()
21
 
22
 
23
+ import gradio as gr
24
+ import spacy
25
+ from spacy import displacy
26
+ import pandas as pd
27
+ import time
28
 
29
  # nlp = spacy.load("en_core_web_md")
30
  # HTML_WRAPPER = "<div style='padding: 10px;'>{}</div>"