new tasks, devnet topup, cli, new model support

This commit is contained in:
Dobromir Popov
2026-07-06 14:17:36 +03:00
parent f841dfaeed
commit b547034741
24 changed files with 1298 additions and 63 deletions

View File

@@ -1387,3 +1387,30 @@ def test_startup_cpu_fallback(tmp_path, monkeypatch):
node.stop()
finally:
tracker.stop()
# --------------------------------------------------- layer detection (US: composite configs)
def test_layers_from_config_top_level():
from meshnet_node.model_catalog import layers_from_config
cfg = types.SimpleNamespace(num_hidden_layers=24)
assert layers_from_config(cfg) == 24
def test_layers_from_config_nested_text_config():
"""VLM/MoE composites (e.g. Qwen3.5-MoE) keep the layer count in text_config."""
from meshnet_node.model_catalog import layers_from_config
cfg = types.SimpleNamespace(text_config=types.SimpleNamespace(num_hidden_layers=40))
assert layers_from_config(cfg) == 40
def test_layers_from_config_get_text_config_and_variants():
from meshnet_node.model_catalog import layers_from_config
inner = types.SimpleNamespace(n_layer=32)
cfg = types.SimpleNamespace(get_text_config=lambda: inner)
assert layers_from_config(cfg) == 32
assert layers_from_config(types.SimpleNamespace()) is None