zjrwtx commited on
Commit
403dca1
1 Parent(s): c4ef3ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,8 +2,8 @@ import requests
2
  import gradio as gr
3
  API_URL = "https://api-inference.huggingface.co/models/philschmid/bart-large-cnn-samsum"
4
  headers = {"Authorization": "Bearer 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","Content-Type": "application/json" }
5
- def query(请输入你要总结的文章内容):
6
- response = requests.post(API_URL, headers=headers, json=payload)
7
  output=response.json()
8
  return output[0]['summary_text']
9
  gr.Interface(query, inputs="text", outputs="text").launch()
 
2
  import gradio as gr
3
  API_URL = "https://api-inference.huggingface.co/models/philschmid/bart-large-cnn-samsum"
4
  headers = {"Authorization": "Bearer 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","Content-Type": "application/json" }
5
+ def query(input_your_article):
6
+ response = requests.post(API_URL, headers=headers, json=input_your_article)
7
  output=response.json()
8
  return output[0]['summary_text']
9
  gr.Interface(query, inputs="text", outputs="text").launch()