File tree Expand file tree Collapse file tree 6 files changed +1064
-4188
lines changed
Expand file tree Collapse file tree 6 files changed +1064
-4188
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ Cosmos-Reason1 is included in [`transformers>=4.51.3`](https://huggingface.co/do
5959
6060We provide example inference scripts:
6161
62- * [ Minimal example] ( scripts/inference_sample .py)
62+ * [ Minimal example] ( examples/inference/inference .py)
6363
6464 ``` shell
65- ./scripts/inference_sample .py
65+ uv run --project examples/project examples/project/inference .py
6666 ```
6767
6868* [ Full example] ( scripts/inference.py )
Original file line number Diff line number Diff line change 1+ 3.10
Original file line number Diff line number Diff line change 1- #!/usr/bin/env -S uv run --script
21# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
32# SPDX-License-Identifier: Apache-2.0
43#
1413# See the License for the specific language governing permissions and
1514# limitations under the License.
1615
17- # https://docs.astral.sh/uv/guides/scripts/#using-a-shebang-to-create-an-executable-file
18- # /// script
19- # requires-python = ">=3.10"
20- # dependencies = [
21- # "accelerate>=1.10.1",
22- # "qwen-vl-utils>=0.0.11",
23- # "torchcodec>=0.6.0",
24- # "torch>=2.7.1",
25- # "transformers>=4.51.3",
26- # "vllm>=0.10.1.1",
27- # ]
28- # [tool.uv.sources]
29- # torch = [
30- # { index = "pytorch-cu128"},
31- # ]
32- # torchvision = [
33- # { index = "pytorch-cu128"},
34- # ]
35- # [[tool.uv.index]]
36- # name = "pytorch-cu128"
37- # url = "https://download.pytorch.org/whl/cu128"
38- # explicit = true
39- # ///
40-
41- """Minimal example of inference with Cosmos-Reason1.
42-
43- Example:
44-
45- ```shell
46- ./scripts/inference_sample.py
47- ```
48- """
16+ """Minimal example of inference with Cosmos-Reason1."""
4917
5018from pathlib import Path
5119
5220import qwen_vl_utils
5321import transformers
5422
55- ROOT = Path (__file__ ).parents [1 ]
23+ ROOT = Path (__file__ ).parents [2 ]
5624SEPARATOR = "-" * 20
5725
5826
@@ -114,4 +82,4 @@ def main():
11482
11583
11684if __name__ == "__main__" :
117- main ()
85+ main ()
Original file line number Diff line number Diff line change 1+ [project ]
2+ name = " cosmos-reason1-inference"
3+ version = " 0.1.0"
4+ requires-python = " >=3.10"
5+ dependencies = [
6+ " accelerate>=1.10.1" ,
7+ " qwen-vl-utils>=0.0.11" ,
8+ " torch>=2.7.1" ,
9+ " torchcodec>=0.6.0" ,
10+ " transformers>=4.51.3" ,
11+ ]
12+ [tool .uv .sources ]
13+ torch = [
14+ { index = " pytorch-cu128" },
15+ ]
16+ torchvision = [
17+ { index = " pytorch-cu128" },
18+ ]
19+
20+ [[tool .uv .index ]]
21+ name = " pytorch-cu128"
22+ url = " https://download.pytorch.org/whl/cu128"
23+ explicit = true
You can’t perform that action at this time.
0 commit comments