Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=
|
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()
|