ffreemt commited on
Commit
0c2094b
·
1 Parent(s): e4c90d5

Update app.py

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. app.py +2 -2
README.md CHANGED
@@ -4,11 +4,11 @@ emoji: 📉
4
  colorFrom: gray
5
  colorTo: indigo
6
  sdk: gradio
7
- sdk_version: 3.1.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
  ---
12
- current sdk_version: 3.6, problem with post api?
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
4
  colorFrom: gray
5
  colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 3.6
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
  ---
12
+ current sdk_version: 3.1.1, fix problem with post api?
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -27,12 +27,12 @@ def gtr(text, from_lang, to_lang):
27
  if __name__ == "__main__":
28
  _ = dedent("""
29
  Paste text here (max. 5000 chars)
30
- (this interface can be accessed via curl https://hf.space/embed/mikeee/gradio-gtr/+/api/predict -d'{"data": ["hello you", "en", "zh"]}'
31
  """).strip()
32
  iface = gr.Interface(
33
  fn=gtr,
34
  inputs=[
35
- gr.Textbox(placeholder="Paste text here (max. 5000 chars)", lines=7,),
36
  gr.Textbox(label="from_lang", value="en", lines=1),
37
  gr.Textbox(label="to_lang", value="zh", lines=1),
38
  ],
 
27
  if __name__ == "__main__":
28
  _ = dedent("""
29
  Paste text here (max. 5000 chars)
30
+ (this interface can be accessed via `import requests; print(requests.post("https://hf.space/embed/mikeee/gradio-gtr/+/api/predict", json={"data": ["hello world", "en", "zh"]}).json()["data"][0]) # '你好世界'`
31
  """).strip()
32
  iface = gr.Interface(
33
  fn=gtr,
34
  inputs=[
35
+ gr.Textbox(placeholder=_, lines=7,),
36
  gr.Textbox(label="from_lang", value="en", lines=1),
37
  gr.Textbox(label="to_lang", value="zh", lines=1),
38
  ],