Spaces:
Runtime error
Runtime error
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,12 +1,82 @@
|
|
| 1 |
-
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo: purple
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
app_file:
|
| 9 |
-
pinned: false
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: JoyCaption Reliable
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
+
app_file: reliable_joycaption.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# π JoyCaption Reliable
|
| 14 |
+
|
| 15 |
+
**Ultra-optimized JoyCaption for ZeroGPU - No more stuck generations!**
|
| 16 |
+
|
| 17 |
+
This is a streamlined version of JoyCaption designed specifically for reliable performance on Hugging Face's ZeroGPU infrastructure. It prioritizes **consistency and speed** over advanced features.
|
| 18 |
+
|
| 19 |
+
## β
Key Optimizations
|
| 20 |
+
|
| 21 |
+
- **45-second GPU limit** - Prevents ZeroGPU timeouts
|
| 22 |
+
- **Aggressive memory cleanup** - Immediate model deletion after each generation
|
| 23 |
+
- **Fast loading** - Optimized with `low_cpu_mem_usage=True`
|
| 24 |
+
- **Progress tracking** - Timestamps show exactly where processing is at
|
| 25 |
+
- **Emergency cleanup** - Graceful error handling with memory clearing
|
| 26 |
+
|
| 27 |
+
## π― Features
|
| 28 |
+
|
| 29 |
+
- **Multiple Styles**: Engaging, Descriptive, SEO-Friendly, Creative
|
| 30 |
+
- **Length Control**: Short (100 tokens), Medium (200 tokens), Long (300 tokens)
|
| 31 |
+
- **Fast Processing**: Typically completes in 15-25 seconds
|
| 32 |
+
- **No Freezing**: Designed to avoid the common ZeroGPU stuck generation issue
|
| 33 |
+
|
| 34 |
+
## π Performance
|
| 35 |
+
|
| 36 |
+
- **Loading**: 5-10 seconds
|
| 37 |
+
- **Generation**: 10-20 seconds
|
| 38 |
+
- **Total Time**: 15-30 seconds
|
| 39 |
+
- **Memory Usage**: Aggressively cleaned after each request
|
| 40 |
+
|
| 41 |
+
## π‘ Why This Version is More Reliable
|
| 42 |
+
|
| 43 |
+
Unlike complex dual-model setups that can timeout or freeze, this version:
|
| 44 |
+
|
| 45 |
+
1. Uses only the JoyCaption model (no secondary Venice model)
|
| 46 |
+
2. Limits GPU duration to prevent ZeroGPU timeouts
|
| 47 |
+
3. Performs immediate cleanup to prevent memory issues
|
| 48 |
+
4. Has simplified prompts for faster processing
|
| 49 |
+
5. Includes progress timestamps to track performance
|
| 50 |
+
|
| 51 |
+
## π§ Technical Details
|
| 52 |
+
|
| 53 |
+
- **Model**: `fancyfeast/llama-joycaption-beta-one-hf-llava`
|
| 54 |
+
- **Framework**: Transformers + PyTorch
|
| 55 |
+
- **Optimization**: `torch.bfloat16`, `device_map="auto"`
|
| 56 |
+
- **GPU Duration**: 45 seconds maximum
|
| 57 |
+
- **Token Limits**: 100-300 based on length setting
|
| 58 |
+
|
| 59 |
+
## π Trade-offs
|
| 60 |
+
|
| 61 |
+
**Gained**:
|
| 62 |
+
- β
Consistent, reliable performance
|
| 63 |
+
- β
Fast loading and generation
|
| 64 |
+
- β
No stuck generations or timeouts
|
| 65 |
+
- β
Predictable timing
|
| 66 |
+
|
| 67 |
+
**Sacrificed**:
|
| 68 |
+
- β No secondary Venice model integration
|
| 69 |
+
- β No advanced keyword injection
|
| 70 |
+
- β No complex correction systems
|
| 71 |
+
- β Reduced maximum output length
|
| 72 |
+
|
| 73 |
+
This version is perfect if you want **reliable, fast captions** without the complexity and potential issues of multi-model systems.
|
| 74 |
+
|
| 75 |
+
## π¨ Caption Styles
|
| 76 |
+
|
| 77 |
+
- **Engaging**: Creative, captivating descriptions that avoid "A photo of"
|
| 78 |
+
- **Descriptive**: Focused on people, poses, clothing, and setting details
|
| 79 |
+
- **SEO-Friendly**: Optimized for search with engaging language
|
| 80 |
+
- **Creative**: Witty captions with interesting, unique language
|
| 81 |
+
|
| 82 |
+
Perfect for content creators, social media managers, and anyone who needs consistent, quality image captions without waiting or worrying about system freezes!
|