William Mattingly
commited on
Commit
Β·
f2533ce
1
Parent(s):
4ca9e1d
init
Browse files
README.md
CHANGED
|
@@ -1,13 +1,125 @@
|
|
| 1 |
---
|
| 2 |
title: NuMarkdown 8B Thinking Demo
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
short_description: Demo for NuMarkdown-8B-Thinking
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: NuMarkdown 8B Thinking Demo
|
| 3 |
+
emoji: π€
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
short_description: Demo for NuMarkdown-8B-Thinking with reasoning capabilities
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# π€ NuMarkdown-8B Reasoning Demo
|
| 14 |
+
|
| 15 |
+
A Gradio-based web application that demonstrates the reasoning capabilities of the NuMarkdown-8B model from NumInd. This app allows users to upload images and see both the model's detailed thinking process and final analysis.
|
| 16 |
+
|
| 17 |
+
## π Features
|
| 18 |
+
|
| 19 |
+
- **Visual Analysis**: Upload any image for AI analysis
|
| 20 |
+
- **Reasoning Transparency**: See the model's step-by-step thinking process
|
| 21 |
+
- **Clean Interface**: Side-by-side layout with tall frames for better visibility
|
| 22 |
+
- **Zero GPU Integration**: Optimized for HuggingFace Spaces with GPU acceleration
|
| 23 |
+
- **Real-time Processing**: Automatic analysis when images are uploaded
|
| 24 |
+
|
| 25 |
+
## π Quick Start
|
| 26 |
+
|
| 27 |
+
### Option 1: Deploy to HuggingFace Spaces (Recommended)
|
| 28 |
+
|
| 29 |
+
1. **Create a new Space** on [HuggingFace Spaces](https://huggingface.co/spaces)
|
| 30 |
+
2. **Choose**:
|
| 31 |
+
- SDK: `Gradio`
|
| 32 |
+
- Hardware: `Zero GPU` (for best performance)
|
| 33 |
+
3. **Upload these files** to your Space:
|
| 34 |
+
- `app.py`
|
| 35 |
+
- `requirements.txt`
|
| 36 |
+
- `README.md`
|
| 37 |
+
4. **Your Space will automatically build and deploy!**
|
| 38 |
+
|
| 39 |
+
### Option 2: Run Locally
|
| 40 |
+
|
| 41 |
+
```bash
|
| 42 |
+
# Clone this repository
|
| 43 |
+
git clone <your-repo-url>
|
| 44 |
+
cd NuMarkdown-8B-Thinking-Demo
|
| 45 |
+
|
| 46 |
+
# Install dependencies
|
| 47 |
+
pip install -r requirements.txt
|
| 48 |
+
|
| 49 |
+
# Run the application
|
| 50 |
+
python app.py
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
The app will be available at `http://localhost:7860`
|
| 54 |
+
|
| 55 |
+
## π§ Technical Details
|
| 56 |
+
|
| 57 |
+
### Model Information
|
| 58 |
+
- **Model**: `numind/NuMarkdown-8B-reasoning`
|
| 59 |
+
- **Type**: Vision-Language Model with reasoning capabilities
|
| 60 |
+
- **Framework**: Qwen2.5-VL architecture
|
| 61 |
+
- **Features**: Structured thinking with `<think>` and `<answer>` tags
|
| 62 |
+
|
| 63 |
+
### Dependencies
|
| 64 |
+
- **Gradio 4.44.0**: Web interface framework
|
| 65 |
+
- **PyTorch**: Deep learning framework
|
| 66 |
+
- **Transformers**: HuggingFace model library
|
| 67 |
+
- **Flash Attention 2**: Optimized attention mechanism
|
| 68 |
+
- **Spaces**: HuggingFace Zero GPU integration
|
| 69 |
+
|
| 70 |
+
## π± How to Use
|
| 71 |
+
|
| 72 |
+
1. **Upload an Image**: Click on the image upload area on the left side
|
| 73 |
+
2. **Wait for Processing**: The model will automatically analyze your image
|
| 74 |
+
3. **View Results**:
|
| 75 |
+
- **Reasoning Panel**: See the model's detailed thinking process
|
| 76 |
+
- **Answer Panel**: Get the final conclusion or analysis
|
| 77 |
+
|
| 78 |
+
## π― Use Cases
|
| 79 |
+
|
| 80 |
+
- **Document Analysis**: Analyze text, tables, charts, and diagrams
|
| 81 |
+
- **Educational Content**: Understand complex visual information
|
| 82 |
+
- **Research**: Extract insights from academic papers and figures
|
| 83 |
+
- **General Vision**: Describe and analyze any visual content
|
| 84 |
+
|
| 85 |
+
## π οΈ Customization
|
| 86 |
+
|
| 87 |
+
### Modify Generation Parameters
|
| 88 |
+
|
| 89 |
+
In `app.py`, you can adjust:
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
model_output = model.generate(
|
| 93 |
+
**model_input,
|
| 94 |
+
temperature=0.7, # Creativity level (0.1-1.0)
|
| 95 |
+
max_new_tokens=5000 # Maximum response length
|
| 96 |
+
)
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
### UI Customization
|
| 100 |
+
|
| 101 |
+
The interface uses custom CSS for tall frames. Modify the `css` parameter in `gr.Blocks()` to adjust the layout.
|
| 102 |
+
|
| 103 |
+
## π Performance Notes
|
| 104 |
+
|
| 105 |
+
- **Zero GPU Spaces**: Provides the best performance for this model
|
| 106 |
+
- **Memory Requirements**: ~16GB VRAM recommended for optimal performance
|
| 107 |
+
- **Processing Time**: Typically 10-30 seconds depending on image complexity
|
| 108 |
+
|
| 109 |
+
## π€ Contributing
|
| 110 |
+
|
| 111 |
+
Feel free to submit issues and enhancement requests!
|
| 112 |
+
|
| 113 |
+
## π License
|
| 114 |
+
|
| 115 |
+
This project is open source. Please check the license of the underlying model (`numind/NuMarkdown-8B-reasoning`) for commercial use restrictions.
|
| 116 |
+
|
| 117 |
+
## π Acknowledgments
|
| 118 |
+
|
| 119 |
+
- **NumInd** for the amazing NuMarkdown-8B-reasoning model
|
| 120 |
+
- **HuggingFace** for the Transformers library and Spaces platform
|
| 121 |
+
- **Gradio** for the easy-to-use web interface framework
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
*Built with β€οΈ for the AI community*
|