Spaces:
Running
on
Zero
Running
on
Zero
debug zerogpu timeout error
Browse files
app.py
CHANGED
|
@@ -205,7 +205,7 @@ def _launch_demo(args, model, processor):
|
|
| 205 |
|
| 206 |
# 关键优化:根据任务类型动态调整 max_new_tokens
|
| 207 |
# OCR 任务通常不需要 8192 tokens,这会导致不必要的等待
|
| 208 |
-
max_new_tokens =
|
| 209 |
print(f"[DEBUG] max_new_tokens: {max_new_tokens}")
|
| 210 |
|
| 211 |
# 添加进度回调
|
|
@@ -765,8 +765,8 @@ def _launch_demo(args, model, processor):
|
|
| 765 |
<div class="feature-section">
|
| 766 |
<div class="section-title">💡 使用建议</div>
|
| 767 |
<ul style="line-height: 2; color: #4b5563; font-size: 14px; margin: 0; padding-left: 20px;">
|
| 768 |
-
<li><strong
|
| 769 |
-
<li><strong>拍摄角度</strong> -
|
| 770 |
<li><strong>文件大小</strong> - 建议单张图片不超过 10MB,支持 JPG/PNG 格式</li>
|
| 771 |
<li><strong>使用场景</strong> - 适用于文字检测识别、文档数字化、票据识别、信息提取、文字图片翻译等</li>
|
| 772 |
<li><strong>合规使用</strong> - 仅供学习研究,请遵守法律法规,尊重隐私权</li>
|
|
|
|
| 205 |
|
| 206 |
# 关键优化:根据任务类型动态调整 max_new_tokens
|
| 207 |
# OCR 任务通常不需要 8192 tokens,这会导致不必要的等待
|
| 208 |
+
max_new_tokens = 2048 # 从 8192 降到 2048,大幅提速
|
| 209 |
print(f"[DEBUG] max_new_tokens: {max_new_tokens}")
|
| 210 |
|
| 211 |
# 添加进度回调
|
|
|
|
| 765 |
<div class="feature-section">
|
| 766 |
<div class="section-title">💡 使用建议</div>
|
| 767 |
<ul style="line-height: 2; color: #4b5563; font-size: 14px; margin: 0; padding-left: 20px;">
|
| 768 |
+
<li><strong>推理框架</strong> - 正式生产推荐使用VLLM,以获取更好的推理性能和精度</li>
|
| 769 |
+
<li><strong>拍摄角度</strong> - 确保图片清晰,光线充足,分辨率适中,避免严重倾斜、遮挡或反光,正面拍摄效果最佳</li>
|
| 770 |
<li><strong>文件大小</strong> - 建议单张图片不超过 10MB,支持 JPG/PNG 格式</li>
|
| 771 |
<li><strong>使用场景</strong> - 适用于文字检测识别、文档数字化、票据识别、信息提取、文字图片翻译等</li>
|
| 772 |
<li><strong>合规使用</strong> - 仅供学习研究,请遵守法律法规,尊重隐私权</li>
|