First Commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# Local Hugging Face Summarizer
|
||||
|
||||
This small service runs a Hugging Face summarization model locally and exposes a simple HTTP API.
|
||||
|
||||
Install (recommended: virtualenv)
|
||||
|
||||
Windows (CPU PyTorch wheel may be required):
|
||||
|
||||
```powershell
|
||||
python -m venv .venv
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
pip install -r requirements.txt
|
||||
# If torch wheel installation is needed, follow instructions at https://pytorch.org
|
||||
python -m uvicorn app:app --host 127.0.0.1 --port 8001 --workers 1
|
||||
```
|
||||
|
||||
Linux / macOS:
|
||||
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
python -m uvicorn app:app --host 127.0.0.1 --port 8001 --workers 1
|
||||
```
|
||||
|
||||
API
|
||||
- `GET /health` — health check
|
||||
- `POST /summarize` — JSON body `{ "text": "...", "max_length": 150, "min_length": 30 }` returns `{ "summary": "...", "cached": false }`
|
||||
|
||||
Notes
|
||||
- Model will be downloaded on first run and can be several hundred MB.
|
||||
- For lower memory usage, consider `sshleifer/tiny-distilbart-cnn-6-6` or `t5-small`.
|
||||
Reference in New Issue
Block a user