freemt commited on
Commit
8485ef2
·
1 Parent(s): 202c5e7

Update interface live=True results in no api

Browse files
Files changed (2) hide show
  1. app.py +9 -2
  2. gradio_cached_examples/log.csv +3 -0
app.py CHANGED
@@ -18,5 +18,12 @@ def ttw_api(query: str) -> Dict:
18
  }
19
 
20
 
21
- iface = gr.Interface(fn=ttw_api, inputs="text", outputs="json")
22
- iface.launch(live=True)
 
 
 
 
 
 
 
 
18
  }
19
 
20
 
21
+ iface = gr.Interface(
22
+ fn=ttw_api,
23
+ inputs="text",
24
+ outputs="json",
25
+ examples=["test", "测试"],
26
+ cache_examples=True,
27
+ # live=True, # api if set to True
28
+ )
29
+ iface.launch()
gradio_cached_examples/log.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ 'output','flag','username','timestamp'
2
+ '{"xyz": "Hello test !!", "abc": "dummy", "hit": ""}','','','2022-07-17 14:51:17.520437'
3
+ '{"xyz": "Hello \u6d4b\u8bd5 !!", "abc": "dummy", "hit": "Bo18A12= <em>\u6d4b\u8bd5</em>\u4eea \u63a2\u6d4b\u4eea\nHg07C09# \u521d\u8bd5 \u590d\u8bd5 \u53e3\u8bd5 \u7b14\u8bd5 \u9762\u8bd5 \u8865\u8003 \u514d\u8bd5 <em>\u6d4b\u8bd5</em> \u7edf\u8003 \u4f1a\u8003 \u9ad8\u8003 \u4e2d\u8003 \u79d1\u8003 \u81ea\u8003"}','','','2022-07-17 14:51:17.630569'