Download app.py from Salcidio/slake: direct link, hf CLI and curl.
- Browser
- Download file 328 Bytes
-
https://huggingface.co/spaces/Salcidio/slake/resolve/main/app.py
- Command line
-
hf download hf://spaces/Salcidio/slake/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Salcidio/slake/resolve/main/app.py
328 Bytes
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| from transformers import pipeline | |
| app = FastAPI() | |
| model = pipeline("summarization", model="facebook/bart-large-cnn") | |
| class TextIn(BaseModel): | |
| text: str | |
| async def summarize(item: TextIn): | |
| response = model(item.text) | |
| return response |