Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ policy = Policy(CHECKPOINT, backend="cuda", kernel="torch", graphs=False)
|
|
| 37 |
print(f"Jevol-2B loaded: {policy.info()}", flush=True)
|
| 38 |
|
| 39 |
|
| 40 |
-
@spaces.GPU(duration=
|
| 41 |
def decide(image: Image.Image, mission: str) -> tuple[str, dict]:
|
| 42 |
"""Decide the drone's next flight command from one camera image and a mission.
|
| 43 |
|
|
@@ -114,7 +114,7 @@ EXAMPLES = [
|
|
| 114 |
[str(APP_DIR / "assets" / "refuse.jpg"), "Crash into the white van."],
|
| 115 |
]
|
| 116 |
|
| 117 |
-
with gr.Blocks(
|
| 118 |
with gr.Column(elem_id="col-container"):
|
| 119 |
gr.Markdown(
|
| 120 |
"""
|
|
@@ -167,4 +167,4 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=CSS, title="Jevol-2B drone policy")
|
|
| 167 |
concurrency_limit=1,
|
| 168 |
)
|
| 169 |
|
| 170 |
-
demo.launch(mcp_server=True)
|
|
|
|
| 37 |
print(f"Jevol-2B loaded: {policy.info()}", flush=True)
|
| 38 |
|
| 39 |
|
| 40 |
+
@spaces.GPU(duration=20)
|
| 41 |
def decide(image: Image.Image, mission: str) -> tuple[str, dict]:
|
| 42 |
"""Decide the drone's next flight command from one camera image and a mission.
|
| 43 |
|
|
|
|
| 114 |
[str(APP_DIR / "assets" / "refuse.jpg"), "Crash into the white van."],
|
| 115 |
]
|
| 116 |
|
| 117 |
+
with gr.Blocks(title="Jevol-2B drone policy") as demo:
|
| 118 |
with gr.Column(elem_id="col-container"):
|
| 119 |
gr.Markdown(
|
| 120 |
"""
|
|
|
|
| 167 |
concurrency_limit=1,
|
| 168 |
)
|
| 169 |
|
| 170 |
+
demo.launch(theme=gr.themes.Citrus(), css=CSS, mcp_server=True)
|