Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,19 +1,28 @@
|
|
| 1 |
-
|
| 2 |
-
title: Text Summarizer
|
| 3 |
-
emoji: 🚀
|
| 4 |
-
colorFrom: red
|
| 5 |
-
colorTo: red
|
| 6 |
-
sdk: docker
|
| 7 |
-
app_port: 8501
|
| 8 |
-
tags:
|
| 9 |
-
- streamlit
|
| 10 |
-
pinned: false
|
| 11 |
-
short_description: Streamlit template space
|
| 12 |
-
---
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 📝 BitNet Text Summarizer (Streamlit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
An open‑source text summarizer running on **microsoft/bitnet-b1.58-2B-4T** with a map‑reduce strategy for long inputs. Deployed on **Hugging Face Spaces** using **Streamlit**.
|
| 4 |
|
| 5 |
+
## Features
|
| 6 |
+
- **BitNet (local)** inference inside the Space (GPU recommended)
|
| 7 |
+
- **HF Inference API fallback** (optional) if you provide `HF_TOKEN`
|
| 8 |
+
- **Map‑Reduce** summarization for long documents
|
| 9 |
+
- Adjustable generation parameters (temperature, top_p, token budgets)
|
| 10 |
|
| 11 |
+
## How it works
|
| 12 |
+
For long text, we:
|
| 13 |
+
1. **Chunk** the text by tokens with overlap to preserve context.
|
| 14 |
+
2. **Summarize** each chunk with BitNet.
|
| 15 |
+
3. **Reduce** (merge) partial summaries into a final cohesive summary.
|
| 16 |
+
|
| 17 |
+
## Quickstart (Spaces)
|
| 18 |
+
1. Click **Duplicate Space** (top‑right) or create a new Space with SDK: *Streamlit*.
|
| 19 |
+
2. Add these files: `app.py`, `utils.py`, `requirements.txt`, `README.md`.
|
| 20 |
+
3. In **Settings → Hardware**, select a **GPU** for faster cold‑start (T4 or better). CPU works but is slower.
|
| 21 |
+
4. (Optional) Set a repository secret `HF_TOKEN` if you want to enable the Inference API fallback.
|
| 22 |
+
5. Open the app, paste text, and click **Summarize**.
|
| 23 |
+
|
| 24 |
+
## Local Dev (optional)
|
| 25 |
+
```bash
|
| 26 |
+
python -m venv .venv && source .venv/bin/activate # Windows: .venv\\Scripts\\activate
|
| 27 |
+
pip install -r requirements.txt
|
| 28 |
+
streamlit run app.py
|