Run this model with HF Jobs
Run nvidia/Cosmos3-Edge on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/nvidia/Cosmos3-Edge. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/nvidia/Cosmos3-Edge on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use nvidia/Cosmos3-Edge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Cosmos
How to use nvidia/Cosmos3-Edge with Cosmos:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Commit ·
97ce140
1
Parent(s): 5b9b37b
Usage: switch reasnor examples to vLLM (#48)
Browse files- Usage: switch reasnor examples to vLLM (aea74fb9d7576027b9d838b2603b42635746ad30)
- Update vLLM video media I/O arguments (25962f78f182c79014542ef449e07d00655ca266)
Co-authored-by: Xuan Li <xuanli1@users.noreply.huggingface.co>
734 unmodified lines7357367377387397407417427435 unmodified lines74975075175275375475575675775875976076176276376476576676776876977077177277377477577677711 unmodified lines789790791792793794795796797734 unmodified lines<img width="1280" src="https://huggingface.co/nvidia/Cosmos3-Edge/resolve/main/assets/edge_action_id_av_1_output.png">### ReasoningThe reasoner generates text from a prompt and an optional image or video (`vision_path`); output is written to `reasoner_text.txt`.Image input:5 unmodified linesThe task is to put flower into the red bottle. Generate a plan consisting of subtasks for accomplish the task.``````shellcat > reasoner_edge.json <<'JSON'{"model_mode": "reasoner","prompt": "The task is to put flower into the red bottle. Generate a plan consisting of subtasks for accomplish the task.","vision_path": "https://huggingface.co/nvidia/Cosmos3-Edge/resolve/main/assets/example_reasoning_input.png"}JSONpython -m cosmos_framework.scripts.inference \--parallelism-preset=latency \-i reasoner_edge.json \-o outputs/reasoner_edge \--checkpoint-path Cosmos3-Edge \--seed 0```The generated text is written to `outputs/reasoner_edge/<sample_name>/reasoner_text.txt`.Example output:```text<think>Got it, let's try to figure out how to put the flower into the red bottle. First, I need to identify the objects: the flower is the green one with the red center, and the red bottle is the red container. So the steps would involve moving the flower to the red bottle.First, the robot arm needs to locate the flower. Then, grasp the flower. After grasping, lift it, then move it towards the red bottle. Then, position the flower over the red bottle's opening, and finally release it into the bottle. Wait, but maybe I need to check if the red bottle has an opening that can accept the flower. Assuming the red bottle is a container with an opening, so the steps would be: move to flower, grasp, lift, move to red bottle, position over opening, release. Let me make sure each step is clear.11 unmodified linesEach step ensures the flower is picked up, transported, and placed into the red bottle in a controlled manner.```Thinking is enabled by default. Disabling it requires setting the reasoner chat template's `enable_thinking=False`, which the offline CLI does not currently expose — use the online serving path (`chat_template_kwargs={"enable_thinking": False}`) for a no-think response.Guardrails are enabled by default (sourced from `nvidia/Cosmos-Guardrail1`); pass `--no-guardrails` to disable, or `--offload-guardrail-models` to keep them on CPU. For multi-GPU recipes, online Ray serving, and the full argument reference, see cosmos-framework `docs/inference.md`.## Limitations734 unmodified lines7357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647655 unmodified lines77177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681711 unmodified lines829830831832833834835836837838839734 unmodified lines<img width="1280" src="https://huggingface.co/nvidia/Cosmos3-Edge/resolve/main/assets/edge_action_id_av_1_output.png">### vLLM#### Container```bashdocker pull vllm/vllm-openai:cosmos3```#### General InvocationYou can use the `vllm` package to deploy the Cosmos3-Edge reasoner as an OpenAI-compatible API endpoint. The recommended vLLM serving configuration for `nvidia/Cosmos3-Edge` on a single GPU is:```bashvllm serve nvidia/Cosmos3-Edge \--host 0.0.0.0 \--port 8000 \--max-model-len 131072 \--allowed-local-media-path / \--mm-processor-kwargs '{"do_resize": true, "min_pixels": 4096, "max_pixels": 16777216}' \--media-io-kwargs '{"video": {"num_frames": 256}}'```#### Examples##### ReasoningImage input:5 unmodified linesThe task is to put flower into the red bottle. Generate a plan consisting of subtasks for accomplish the task.``````pythonimport base64import jsonfrom pathlib import Pathimport openai# 1. Read the image reasoning promptexample = json.load(open("assets/example_reasoning_prompt.json"))image_path = Path("assets/example_reasoning_input.png").resolve()image_url = ("data:image/png;base64," + base64.b64encode(image_path.read_bytes()).decode())# 2. Query the OpenAI-compatible vLLM serverclient = openai.OpenAI(api_key="EMPTY",base_url="http://localhost:8000/v1",)response = client.chat.completions.create(model=client.models.list().data[0].id,messages=[{"role": "user","content": [{"type": "image_url", "image_url": {"url": image_url}},{"type": "text", "text": example["prompt"]},],},],max_tokens=example["max_tokens"],)# 3. Print the default response (thinking is enabled)print(response.choices[0].message.content)```Example output:```textGot it, let's try to figure out how to put the flower into the red bottle. First, I need to identify the objects: the flower is the green one with the red center, and the red bottle is the red container. So the steps would involve moving the flower to the red bottle.First, the robot arm needs to locate the flower. Then, grasp the flower. After grasping, lift it, then move it towards the red bottle. Then, position the flower over the red bottle's opening, and finally release it into the bottle. Wait, but maybe I need to check if the red bottle has an opening that can accept the flower. Assuming the red bottle is a container with an opening, so the steps would be: move to flower, grasp, lift, move to red bottle, position over opening, release. Let me make sure each step is clear.11 unmodified linesEach step ensures the flower is picked up, transported, and placed into the red bottle in a controlled manner.```Thinking is enabled by default. To disable it, add the following argument to the `client.chat.completions.create(...)` call:```pythonextra_body={"chat_template_kwargs": {"enable_thinking": False}}```## Limitations
README.md+64-22