Spaces:
Runtime error
Runtime error
Download modules/summarizer.py from Adityasv99/ClipForge-AI: direct link, hf CLI and curl.
- Browser
- Download file 258 Bytes
-
https://huggingface.co/spaces/Adityasv99/ClipForge-AI/resolve/main/modules/summarizer.py
- Command line
-
hf download hf://spaces/Adityasv99/ClipForge-AI/modules/summarizer.py
-
curl -L -o summarizer.py https://huggingface.co/spaces/Adityasv99/ClipForge-AI/resolve/main/modules/summarizer.py
258 Bytes
| from huggingface_hub import InferenceClient | |
| import os | |
| client = InferenceClient(token=os.getenv("HF_TOKEN")) | |
| def summarize_text(text): | |
| response = client.summarization( | |
| text, | |
| model="facebook/bart-large-cnn" | |
| ) | |
| return response["summary_text"] | |