Spaces:
Paused
Paused
root commited on
Commit ·
bf68423
1
Parent(s): 09cbe60
fix link
Browse filesFiles changed (3)
104 unmodified lines10510610710810911011112 unmodified lines12412512612712812913026 unmodified lines157158159160161162163147 unmodified lines3113123133143153168 unmodified lines3253263273283293304 unmodified lines3353363373383393401 unmodified line342343344345346347348104 unmodified linestry:# 关键改动:带上 headersresp = requests.post(api_url, json=payload, headers=JSON_HEADERS, timeout=120)resp.raise_for_status()data = resp.json()except requests.exceptions.RequestException as e:12 unmodified linesdef url_to_base64_data_url(url: str) -> str:"""Downloads an image from a URL and formats it as a Base64 Data URL for Markdown."""try:response = requests.get(url, timeout=30)response.raise_for_status()mime_type = response.headers.get('Content-Type', 'image/jpeg')if not mime_type.startswith('image/'):26 unmodified linesprint(f"Warning: Invalid URL provided for visualization image: {url}")return Nonetry:response = requests.get(url, timeout=30)response.raise_for_status()image_bytes = response.contentpil_image = Image.open(io.BytesIO(image_bytes)).convert("RGB")147 unmodified lines/* Markdown 预览区 (vh -> px) */#md_preview_vl, #md_preview_doc {max-height: 540px; /* 原为 60vh */overflow: auto;scrollbar-gutter: stable both-edges;}8 unmodified linesmax-width: 100%;height: auto;}"""4 unmodified lines<img src="{logo_data_url}" alt="App Logo" style="max-height:10%; width: auto; margin: 10px auto; display: block;"></div>""")gr.HTML("""<div class="quick-links"><a href="https://github.com/PaddlePaddle/PaddleOCR" target="_blank">GitHub</a> |1 unmodified line<a href="https://huggingface.co/spaces/PaddlePaddle/PaddleOCR-VL_Online_Demo" target="_blank">Model</a></div>""")with gr.Tabs():with gr.Tab("Document Parsing"):with gr.Row():104 unmodified lines10510610710810911011112 unmodified lines12412512612712812913026 unmodified lines157158159160161162163147 unmodified lines3113123133143153163178 unmodified lines3263273283293303313323333343353363373383393403413423433443453464 unmodified lines3513523533543553563573583593603613623633643651 unmodified line367368369370371372104 unmodified linestry:# 关键改动:带上 headersresp = requests.post(api_url, json=payload, headers=JSON_HEADERS, timeout=600)resp.raise_for_status()data = resp.json()except requests.exceptions.RequestException as e:12 unmodified linesdef url_to_base64_data_url(url: str) -> str:"""Downloads an image from a URL and formats it as a Base64 Data URL for Markdown."""try:response = requests.get(url, timeout=600)response.raise_for_status()mime_type = response.headers.get('Content-Type', 'image/jpeg')if not mime_type.startswith('image/'):26 unmodified linesprint(f"Warning: Invalid URL provided for visualization image: {url}")return Nonetry:response = requests.get(url, timeout=600)response.raise_for_status()image_bytes = response.contentpil_image = Image.open(io.BytesIO(image_bytes)).convert("RGB")147 unmodified lines/* Markdown 预览区 (vh -> px) */#md_preview_vl, #md_preview_doc {max-height: 540px; /* 原为 60vh */min-height: 180px;overflow: auto;scrollbar-gutter: stable both-edges;}8 unmodified linesmax-width: 100%;height: auto;}/* Notice banner */.notice {margin: 8px auto 0;max-width: 900px;padding: 10px 12px;border: 1px solid #e5e7eb;border-radius: 8px;background: #f8fafc;font-size: 14px;line-height: 1.6;}.notice strong { font-weight: 700; }.notice a { color: #3b82f6; text-decoration: none; }.notice a:hover { text-decoration: underline; }"""4 unmodified lines<img src="{logo_data_url}" alt="App Logo" style="max-height:10%; width: auto; margin: 10px auto; display: block;"></div>""")gr.HTML("""<div class="notice"><strong>Heads up:</strong> The Hugging Face demo can be slow at times.For a faster experience, please try<a href="https://modelscope.cn/studios/PaddlePaddle/PaddleOCR-VL_Online_Demo/summary" target="_blank" rel="noopener noreferrer">ModelScope</a>or<a href="https://aistudio.baidu.com/application/detail/98365" target="_blank" rel="noopener noreferrer">Baidu AI Studio</a>.</div>""")gr.HTML("""<div class="quick-links"><a href="https://github.com/PaddlePaddle/PaddleOCR" target="_blank">GitHub</a> |1 unmodified line<a href="https://huggingface.co/spaces/PaddlePaddle/PaddleOCR-VL_Online_Demo" target="_blank">Model</a></div>""")with gr.Tabs():with gr.Tab("Document Parsing"):with gr.Row():
app.py+28-4
examples/targeted/e5829e2de95961b2cf97e1c86b21d880.png → examples/complex/7a9050172ce7d3be4abcd2bca9bd6dcc.pngRenamed

Large File Pointer Details
- SHA256: 9557993dc5b11c318466d393c497b80d15e2a323e68d1d4f9fef8018227cc681
- Pointer size: 131 Bytes
- Size of remote file: 394 kB

Large File Pointer Details
- SHA256: 0217a7616aaccc88c7816d309dd571e4bc92199eb11083ff5eee7734751adb77
- Pointer size: 131 Bytes
- Size of remote file: 799 kB
examples/targeted/54c7101449aff77e6d9ab8270b3d2c38.pngAdded

Large File Pointer Details
- SHA256: ea3837948840db32bab8a6144d35d7ea1b2c42c324880d6f6119ee68b1c47db2
- Pointer size: 131 Bytes
- Size of remote file: 576 kB