import requests import gradio as gr API_URL = "https://api-inference.huggingface.co/models/philschmid/bart-large-cnn-samsum" headers = {"Authorization": "Bearer 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","Content-Type": "application/json" } def query(input_your_article): response = requests.post(API_URL, headers=headers, json=input_your_article) output=response.json() return output[0]['summary_text'] gr.Interface(query, inputs="text", outputs="text").launch()