cactus-compute 4.2.0__tar.gz → 4.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cactus_compute-4.2.0/cactus_compute.egg-info → cactus_compute-4.2.2}/PKG-INFO +6 -2
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/README.md +5 -1
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/__init__.py +1 -1
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/agent/fetch.py +3 -3
- cactus_compute-4.2.2/cactus/mlx/kernels/bicubic_resize.metal +15 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/vision.py +52 -42
- {cactus_compute-4.2.0 → cactus_compute-4.2.2/cactus_compute.egg-info}/PKG-INFO +6 -2
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus_compute.egg-info/SOURCES.txt +1 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/llms.txt +1 -1
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/pyproject.toml +1 -1
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/LICENSE +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/MANIFEST.in +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/__main__.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/_telemetry.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/_worker.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/agent/__init__.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/agent/audio.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/agent/grounding.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/agent/mirage.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/agent/runtime.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/agent/text.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/agent/tools.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/agent/whistle.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/cli/__init__.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/cli/download.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/cli/logging.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/cli/parser.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/cli/speech.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/cli/vision.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/environments/__init__.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/environments/_harness.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/environments/data_capture.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/environments/kitchen_appliance.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/environments/media_player.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/environments/productivity.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/environments/smart_home.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/environments/wearable.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/NOTICE +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/__init__.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/_environment.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/bench_decode.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/checkpoint.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/cli.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/generate.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/generation.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/kernels/common.metal +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/kernels/gather.metal +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/kernels/int_dot.metal +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/kernels/matvec_int.metal +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/kernels/matvec_lut.metal +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/kernels/prepare_permute.metal +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/kernels/ssm_verify.metal +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/models/__init__.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/models/nemotron.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/models/nemotron_decode.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/models/nemotron_mtp.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/models/nemotron_speculative.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/models/nemotron_validate.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/models/nemotron_verify.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/models/nemotron_vision.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/ops.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/reference.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/runtime.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/mlx/server.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/__init__.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/architecture.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/architecture_mlx.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/build.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/checkpoints.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/config.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/export.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/finetune.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/quantize.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/quantize_mlx.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/run.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/tokenizer.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/whistle.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/model/whistle_finetune.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/platform.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/playground/__init__.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/playground/app.js +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/playground/index.html +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/playground/server.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus/playground/style.css +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus_compute.egg-info/dependency_links.txt +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus_compute.egg-info/entry_points.txt +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus_compute.egg-info/requires.txt +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/cactus_compute.egg-info/top_level.txt +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/setup.cfg +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_build.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_environments.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_fetch.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_finetune.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_generate.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_grounding.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_inference.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_lora.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_mirage.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_mlx.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_mlx_entrypoint.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_packaging.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_platform.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_playground.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_quantize_mlx.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_release.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_render.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_run.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_tools.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_weights.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_whistle.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_whistle_finetune.py +0 -0
- {cactus_compute-4.2.0 → cactus_compute-4.2.2}/tests/test_worker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cactus-compute
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.2
|
|
4
4
|
Summary: Local voice, vision, agents and quantized language-model inference.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://cactuscompute.com
|
|
@@ -140,4 +140,8 @@ installing this release. Its Python imports move from `cactus_mlx` to `cactus.ml
|
|
|
140
140
|
|
|
141
141
|
Migrating from `cactus-needle`? Use `import cactus` and the `cactus` command. Needle 2 remains on the [legacy branch](https://github.com/cactus-compute/cactus/tree/legacy) with `cactus-compute<4`. The earlier general inference SDK is now [cactus-engine](https://pypi.org/project/cactus-engine/).
|
|
142
142
|
|
|
143
|
-
Anonymous Python usage counts can be disabled with `CACTUS_TELEMETRY=0`.
|
|
143
|
+
Anonymous Python usage counts can be disabled with `CACTUS_TELEMETRY=0`.
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
[Apache 2.0](LICENSE), including the prebuilt runtime binaries.
|
|
@@ -90,4 +90,8 @@ installing this release. Its Python imports move from `cactus_mlx` to `cactus.ml
|
|
|
90
90
|
|
|
91
91
|
Migrating from `cactus-needle`? Use `import cactus` and the `cactus` command. Needle 2 remains on the [legacy branch](https://github.com/cactus-compute/cactus/tree/legacy) with `cactus-compute<4`. The earlier general inference SDK is now [cactus-engine](https://pypi.org/project/cactus-engine/).
|
|
92
92
|
|
|
93
|
-
Anonymous Python usage counts can be disabled with `CACTUS_TELEMETRY=0`.
|
|
93
|
+
Anonymous Python usage counts can be disabled with `CACTUS_TELEMETRY=0`.
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
[Apache 2.0](LICENSE), including the prebuilt runtime binaries.
|
|
@@ -5,7 +5,7 @@ from .agent.tools import Field, tool
|
|
|
5
5
|
from .agent.grounding import ExtractionValidationError
|
|
6
6
|
from .agent.runtime import set_threads
|
|
7
7
|
|
|
8
|
-
__version__ = "4.2.
|
|
8
|
+
__version__ = "4.2.2"
|
|
9
9
|
Needle = Cactus
|
|
10
10
|
|
|
11
11
|
__all__ = ["Cactus", "Needle", "Whistle", "Mirage", "Field", "tool", "extract",
|
|
@@ -11,9 +11,9 @@ import zipfile
|
|
|
11
11
|
WHISTLE = "whistle"
|
|
12
12
|
MIRAGE = "mirage"
|
|
13
13
|
ENGINE_REPO = "Cactus-Compute/cactus"
|
|
14
|
-
ENGINE_VERSION = "4.1.
|
|
15
|
-
ENGINE_REVISION = "
|
|
16
|
-
MANIFEST_SHA256 = "
|
|
14
|
+
ENGINE_VERSION = "4.1.1"
|
|
15
|
+
ENGINE_REVISION = "d2c5cd70432ed78345f3ba6b620bff2feeec6c86"
|
|
16
|
+
MANIFEST_SHA256 = "27168631232dbff52a205b54bbfad54fd9b81f06fa368657d07449e2221f5e25"
|
|
17
17
|
MODEL_REPOS = {3: "Cactus-Compute/needle3", WHISTLE: "Cactus-Compute/whistle", MIRAGE: "Cactus-Compute/mirage"}
|
|
18
18
|
MODEL_REVISIONS = {
|
|
19
19
|
3: "d6c7d6a2e9655505e0f8e23339356dd1705900eb",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
uint x = thread_position_in_grid.x, y = thread_position_in_grid.y;
|
|
2
|
+
uint width = column_weights_shape[0], column_taps = column_weights_shape[1], row_taps = row_weights_shape[1];
|
|
3
|
+
float3 total = 0.0f;
|
|
4
|
+
for (uint r = 0; r < row_taps; ++r) {
|
|
5
|
+
ulong row = ulong(rows[y * row_taps + r]) * pixels_shape[1];
|
|
6
|
+
float3 line = 0.0f;
|
|
7
|
+
for (uint c = 0; c < column_taps; ++c) {
|
|
8
|
+
ulong p = (row + columns[x * column_taps + c]) * 3;
|
|
9
|
+
line += column_weights[x * column_taps + c] * float3(pixels[p], pixels[p + 1], pixels[p + 2]);
|
|
10
|
+
}
|
|
11
|
+
total += row_weights[y * row_taps + r] * line;
|
|
12
|
+
}
|
|
13
|
+
uint plane = row_weights_shape[0] * width;
|
|
14
|
+
for (uint channel = 0; channel < 3; ++channel)
|
|
15
|
+
out[channel * plane + y * width + x] = (total[channel] / 255.0f - mean[channel]) / std[channel];
|
|
@@ -2,24 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
Patch sizing follows NVIDIA's NemotronH Omni image processor (Apache-2.0).
|
|
4
4
|
Copyright (c) 2026 NVIDIA CORPORATION. All rights reserved.
|
|
5
|
-
Modified by Cactus Compute:
|
|
5
|
+
Modified by Cactus Compute: Metal resizing and MLX-LM processor interface.
|
|
6
6
|
Licensed under the Apache License, Version 2.0; see LICENSE.
|
|
7
7
|
"""
|
|
8
8
|
import base64
|
|
9
9
|
import io
|
|
10
10
|
import math
|
|
11
|
+
from functools import cache, lru_cache
|
|
11
12
|
from pathlib import Path
|
|
12
13
|
from urllib.request import urlopen
|
|
13
14
|
|
|
15
|
+
import mlx.core as mx
|
|
14
16
|
import numpy as np
|
|
15
17
|
from PIL import Image
|
|
16
18
|
|
|
19
|
+
from .ops import KERNELS
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _rgb_pixels(image):
|
|
23
|
+
return np.asarray(image if image.mode == 'RGB' else image.convert('RGB'))
|
|
24
|
+
|
|
17
25
|
|
|
18
26
|
def load_image(source):
|
|
19
|
-
if isinstance(source, Image.Image):
|
|
20
|
-
return source.convert('RGB')
|
|
21
27
|
if isinstance(source, np.ndarray):
|
|
22
|
-
|
|
28
|
+
source = Image.fromarray(source)
|
|
29
|
+
if isinstance(source, Image.Image):
|
|
30
|
+
return _rgb_pixels(source)
|
|
23
31
|
source = str(source)
|
|
24
32
|
if source.startswith('data:'):
|
|
25
33
|
source = io.BytesIO(base64.b64decode(source.partition(',')[2], validate=True))
|
|
@@ -29,39 +37,43 @@ def load_image(source):
|
|
|
29
37
|
else:
|
|
30
38
|
source = Path(source).expanduser()
|
|
31
39
|
with Image.open(source) as image:
|
|
32
|
-
return image
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return
|
|
40
|
+
return _rgb_pixels(image)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@lru_cache(maxsize=32)
|
|
44
|
+
def _bicubic_taps(original, output):
|
|
45
|
+
scale = np.float32(original / output)
|
|
46
|
+
filter_scale = np.maximum(scale, np.float32(1))
|
|
47
|
+
support = np.float32(2) * filter_scale
|
|
48
|
+
center = scale * (np.arange(output, dtype=np.float32) + np.float32(0.5))
|
|
49
|
+
first = np.maximum(0, (center - support + np.float32(0.5)).astype(np.int64))
|
|
50
|
+
end = np.minimum(original, (center + support + np.float32(0.5)).astype(np.int64))
|
|
51
|
+
position = first[:, None] + np.arange((end - first).max())
|
|
52
|
+
x = np.abs((position.astype(np.float32) + np.float32(0.5) - center[:, None]) / filter_scale)
|
|
53
|
+
weights = np.where(x < 1, ((np.float32(1.5) * x - np.float32(2.5)) * x) * x + 1,
|
|
54
|
+
((np.float32(-0.5) * x + np.float32(2.5)) * x - 4) * x + 2)
|
|
55
|
+
weights[(x >= 2) | (position >= end[:, None])] = 0
|
|
56
|
+
weights /= weights.sum(axis=1, keepdims=True, dtype=np.float32)
|
|
57
|
+
return mx.array(weights), mx.array(np.minimum(position, original - 1).astype(np.uint32))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@cache
|
|
61
|
+
def _resize_kernel():
|
|
62
|
+
return mx.fast.metal_kernel(
|
|
63
|
+
name='bicubic_resize', output_names=['out'],
|
|
64
|
+
input_names=['pixels', 'column_weights', 'columns', 'row_weights', 'rows', 'mean', 'std'],
|
|
65
|
+
source=(KERNELS / 'bicubic_resize.metal').read_text(), compile_options={'math_mode': 'safe'})
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def resize_bicubic(image, height, width, mean, std):
|
|
69
|
+
"""Antialiased bicubic resize to float32 (3, height, width) as (x / 255 - mean) / std, with PyTorch's overshoot."""
|
|
70
|
+
column_weights, columns = _bicubic_taps(image.shape[1], width)
|
|
71
|
+
row_weights, rows = _bicubic_taps(image.shape[0], height)
|
|
72
|
+
return _resize_kernel()(
|
|
73
|
+
inputs=[mx.array(image), column_weights, columns, row_weights, rows,
|
|
74
|
+
mx.array(mean, mx.float32), mx.array(std, mx.float32)],
|
|
75
|
+
grid=(width, height, 1), threadgroup=(16, 16, 1),
|
|
76
|
+
output_shapes=[(3, height, width)], output_dtypes=[mx.float32])[0]
|
|
65
77
|
|
|
66
78
|
|
|
67
79
|
class ImageProcessor:
|
|
@@ -92,11 +104,9 @@ class ImageProcessor:
|
|
|
92
104
|
return hp * self.patch_size, wp * self.patch_size
|
|
93
105
|
|
|
94
106
|
def preprocess(self, source):
|
|
95
|
-
|
|
96
|
-
height, width = self.target_size(
|
|
97
|
-
|
|
98
|
-
pixels = (pixels / np.float32(255) - self.mean) / self.std
|
|
99
|
-
return pixels.transpose(2, 0, 1).copy()
|
|
107
|
+
pixels = load_image(source)
|
|
108
|
+
height, width = self.target_size(pixels.shape[1], pixels.shape[0])
|
|
109
|
+
return resize_bicubic(pixels, height, width, self.mean, self.std)
|
|
100
110
|
|
|
101
111
|
def __call__(self, text, *, images):
|
|
102
112
|
parts = text.split(self.image_token)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cactus-compute
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.2
|
|
4
4
|
Summary: Local voice, vision, agents and quantized language-model inference.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://cactuscompute.com
|
|
@@ -140,4 +140,8 @@ installing this release. Its Python imports move from `cactus_mlx` to `cactus.ml
|
|
|
140
140
|
|
|
141
141
|
Migrating from `cactus-needle`? Use `import cactus` and the `cactus` command. Needle 2 remains on the [legacy branch](https://github.com/cactus-compute/cactus/tree/legacy) with `cactus-compute<4`. The earlier general inference SDK is now [cactus-engine](https://pypi.org/project/cactus-engine/).
|
|
142
142
|
|
|
143
|
-
Anonymous Python usage counts can be disabled with `CACTUS_TELEMETRY=0`.
|
|
143
|
+
Anonymous Python usage counts can be disabled with `CACTUS_TELEMETRY=0`.
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
[Apache 2.0](LICENSE), including the prebuilt runtime binaries.
|
|
@@ -296,5 +296,5 @@ Adapt by swapping the Literal values for your own and keeping the shapes: closed
|
|
|
296
296
|
|
|
297
297
|
## Telemetry
|
|
298
298
|
|
|
299
|
-
Anonymous usage counts only (function name, package version, OS, random install id - never prompts, outputs, or data). Opt out with `
|
|
299
|
+
Anonymous usage counts only (function name, package version, OS, random install id - never prompts, outputs, or data). Opt out with `CACTUS_TELEMETRY=0` or `DO_NOT_TRACK=1`; `CI` environments are excluded automatically.
|
|
300
300
|
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|