Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -208,6 +208,8 @@ video_examples = [
|
|
208 |
["Explain the ad in detail.", "videos/1.mp4"]
|
209 |
]
|
210 |
|
|
|
|
|
211 |
css = """
|
212 |
.submit-btn {
|
213 |
background-color: #2980b9 !important;
|
@@ -216,7 +218,15 @@ css = """
|
|
216 |
.submit-btn:hover {
|
217 |
background-color: #3498db !important;
|
218 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
"""
|
|
|
|
|
220 |
|
221 |
# Create the Gradio Interface
|
222 |
with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
@@ -246,19 +256,26 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
246 |
top_p = gr.Slider(label="Top-p (nucleus sampling)", minimum=0.05, maximum=1.0, step=0.05, value=0.9)
|
247 |
top_k = gr.Slider(label="Top-k", minimum=1, maximum=1000, step=1, value=50)
|
248 |
repetition_penalty = gr.Slider(label="Repetition penalty", minimum=1.0, maximum=2.0, step=0.05, value=1.2)
|
|
|
249 |
with gr.Column():
|
250 |
-
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
model_choice = gr.Radio(
|
253 |
choices=["DREX-062225-exp", "VIREX-062225-exp", "olmOCR-7B-0225"],
|
254 |
label="Select Model",
|
255 |
value="DREX-062225-exp"
|
256 |
)
|
257 |
-
|
258 |
gr.Markdown("**Model Info π»** | [Report Bug](https://huggingface.co/spaces/prithivMLmods/Doc-VLMs/discussions)")
|
259 |
gr.Markdown("> [DREX-062225-exp](https://huggingface.co/prithivMLmods/DREX-062225-exp): the drex-062225-exp (document retrieval and extraction expert) model is a specialized fine-tuned version of docscopeocr-7b-050425-exp, optimized for document retrieval, content extraction, and analysis recognition. built on top of the qwen2.5-vl architecture.")
|
260 |
gr.Markdown("> [VIREX-062225-exp](https://huggingface.co/prithivMLmods/VIREX-062225-exp): the virex-062225-exp (video information retrieval and extraction expert - experimental) model is a fine-tuned version of qwen2.5-vl-7b-instruct, specifically optimized for advanced video understanding, image comprehension, sense of reasoning, and natural language decision-making through cot reasoning.")
|
261 |
-
gr.Markdown("> [olmOCR-7B-0225](https://huggingface.co/allenai/olmOCR-7B-0225-preview): the olmocr-7b-0225-preview model is based on qwen2-vl-7b, optimized for document-level optical character recognition (ocr), long-context vision-language understanding, and accurate image-to-text conversion with mathematical latex formatting. designed with a focus on high-fidelity visual-textual comprehension.")
|
262 |
|
263 |
image_submit.click(
|
264 |
fn=generate_image,
|
|
|
208 |
["Explain the ad in detail.", "videos/1.mp4"]
|
209 |
]
|
210 |
|
211 |
+
# --- CODE MODIFICATION START ---
|
212 |
+
# Added CSS to style the output area as a "Canvas"
|
213 |
css = """
|
214 |
.submit-btn {
|
215 |
background-color: #2980b9 !important;
|
|
|
218 |
.submit-btn:hover {
|
219 |
background-color: #3498db !important;
|
220 |
}
|
221 |
+
.canvas-output {
|
222 |
+
border: 2px solid #e0e0e0;
|
223 |
+
border-radius: 10px;
|
224 |
+
padding: 20px;
|
225 |
+
background-color: #f9f9f9;
|
226 |
+
}
|
227 |
"""
|
228 |
+
# --- CODE MODIFICATION END ---
|
229 |
+
|
230 |
|
231 |
# Create the Gradio Interface
|
232 |
with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
|
256 |
top_p = gr.Slider(label="Top-p (nucleus sampling)", minimum=0.05, maximum=1.0, step=0.05, value=0.9)
|
257 |
top_k = gr.Slider(label="Top-k", minimum=1, maximum=1000, step=1, value=50)
|
258 |
repetition_penalty = gr.Slider(label="Repetition penalty", minimum=1.0, maximum=2.0, step=0.05, value=1.2)
|
259 |
+
|
260 |
with gr.Column():
|
261 |
+
# --- CODE MODIFICATION START ---
|
262 |
+
# Wrapped the outputs in a styled Column to act as the Canvas
|
263 |
+
with gr.Column(elem_classes="canvas-output"):
|
264 |
+
gr.Markdown("## π Result Canvas")
|
265 |
+
output = gr.Textbox(label="Raw Output Stream", interactive=False, lines=2)
|
266 |
+
markdown_output = gr.Markdown(label="Formatted Result (Result.Md)")
|
267 |
+
# --- CODE MODIFICATION END ---
|
268 |
+
|
269 |
model_choice = gr.Radio(
|
270 |
choices=["DREX-062225-exp", "VIREX-062225-exp", "olmOCR-7B-0225"],
|
271 |
label="Select Model",
|
272 |
value="DREX-062225-exp"
|
273 |
)
|
274 |
+
|
275 |
gr.Markdown("**Model Info π»** | [Report Bug](https://huggingface.co/spaces/prithivMLmods/Doc-VLMs/discussions)")
|
276 |
gr.Markdown("> [DREX-062225-exp](https://huggingface.co/prithivMLmods/DREX-062225-exp): the drex-062225-exp (document retrieval and extraction expert) model is a specialized fine-tuned version of docscopeocr-7b-050425-exp, optimized for document retrieval, content extraction, and analysis recognition. built on top of the qwen2.5-vl architecture.")
|
277 |
gr.Markdown("> [VIREX-062225-exp](https://huggingface.co/prithivMLmods/VIREX-062225-exp): the virex-062225-exp (video information retrieval and extraction expert - experimental) model is a fine-tuned version of qwen2.5-vl-7b-instruct, specifically optimized for advanced video understanding, image comprehension, sense of reasoning, and natural language decision-making through cot reasoning.")
|
278 |
+
gr.Markdown("> [olmOCR-7B-0225](https://huggingface.co/allenai/olmOCR-7B-0225-preview): the olmocr-7b-0225-preview model is based on qwen2-vl-7b, optimized for document-level optical character recognition (ocr), long-context vision-language understanding, and accurate image-to-text conversion with mathematical latex formatting. designed with a focus on high-fidelity visual-textual comprehension.")
|
279 |
|
280 |
image_submit.click(
|
281 |
fn=generate_image,
|