Spaces:
Sleeping
Sleeping
Download app.py from Precieuxokit23/OKITAKOY-AI: direct link, hf CLI and curl.
- Browser
- Download file 642 Bytes
-
https://huggingface.co/spaces/Precieuxokit23/OKITAKOY-AI/resolve/main/app.py
- Command line
-
hf download hf://spaces/Precieuxokit23/OKITAKOY-AI/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Precieuxokit23/OKITAKOY-AI/resolve/main/app.py
642 Bytes
| from transformers import pipeline | |
| import gradio as gr | |
| # Charge un modèle de summarization (résumé) | |
| summarizer = pipeline("summarization", model="facebook/bart-large-cnn") | |
| def resumetexte(texte): | |
| # Résume le texte (max 130 tokens de résumé) | |
| result = summarizer(texte, max_length=130, min_length=30, do_sample=False) | |
| return result[0]['summary_text'] | |
| iface = gr.Interface( | |
| fn=resumetexte, | |
| inputs=gr.Textbox(lines=10, placeholder="Colle ici ton texte à résumer..."), | |
| outputs="text", | |
| title="Résumé automatique", | |
| description="Colle un texte, et obtient un résumé généré par BART." | |
| ) | |
| iface.launch() |