Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -36,7 +36,7 @@ USER_TEXT = (
|
|
| 36 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
| 37 |
model = AutoModelForImageTextToText.from_pretrained(
|
| 38 |
MODEL_ID,
|
| 39 |
-
|
| 40 |
).to("cuda")
|
| 41 |
|
| 42 |
|
|
@@ -96,7 +96,7 @@ CSS = """
|
|
| 96 |
.dark .gradio-container { color: var(--body-text-color); }
|
| 97 |
"""
|
| 98 |
|
| 99 |
-
with gr.Blocks(
|
| 100 |
gr.Markdown(
|
| 101 |
"# 🖥️ WebBrain VL 2 450M — Browser Screenshot Understanding\n"
|
| 102 |
"Upload a browser screenshot to get a structured six-section observation "
|
|
@@ -135,7 +135,6 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=CSS) as demo:
|
|
| 135 |
label="Structured Observation",
|
| 136 |
lines=24,
|
| 137 |
max_lines=50,
|
| 138 |
-
show_copy_button=True,
|
| 139 |
)
|
| 140 |
|
| 141 |
run_btn.click(
|
|
@@ -160,4 +159,4 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=CSS) as demo:
|
|
| 160 |
|
| 161 |
|
| 162 |
if __name__ == "__main__":
|
| 163 |
-
demo.launch(mcp_server=True)
|
|
|
|
| 36 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
| 37 |
model = AutoModelForImageTextToText.from_pretrained(
|
| 38 |
MODEL_ID,
|
| 39 |
+
dtype=torch.bfloat16,
|
| 40 |
).to("cuda")
|
| 41 |
|
| 42 |
|
|
|
|
| 96 |
.dark .gradio-container { color: var(--body-text-color); }
|
| 97 |
"""
|
| 98 |
|
| 99 |
+
with gr.Blocks() as demo:
|
| 100 |
gr.Markdown(
|
| 101 |
"# 🖥️ WebBrain VL 2 450M — Browser Screenshot Understanding\n"
|
| 102 |
"Upload a browser screenshot to get a structured six-section observation "
|
|
|
|
| 135 |
label="Structured Observation",
|
| 136 |
lines=24,
|
| 137 |
max_lines=50,
|
|
|
|
| 138 |
)
|
| 139 |
|
| 140 |
run_btn.click(
|
|
|
|
| 159 |
|
| 160 |
|
| 161 |
if __name__ == "__main__":
|
| 162 |
+
demo.launch(mcp_server=True, theme=gr.themes.Citrus(), css=CSS)
|