Skip to content

Commit cd11d08

Browse files
author
Shaw
committed
chore: commit current runner and docs updates
1 parent bebb0ca commit cd11d08

3 files changed

Lines changed: 49 additions & 12 deletions

File tree

packages/benchmarks/orchestrator/runner.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,11 +1716,19 @@ def _score_from_saved_result(result_path: Path, metrics: dict[str, Any]) -> floa
17161716
[
17171717
payload.get("score"),
17181718
payload.get("accuracy"),
1719+
payload.get("pass_at_1"),
1720+
payload.get("transcriptionNormalizedAccuracy"),
17191721
(payload.get("summary") or {}).get("accuracy")
17201722
if isinstance(payload.get("summary"), dict)
17211723
else None,
17221724
]
17231725
)
1726+
summary = payload.get("summary")
1727+
if isinstance(summary, dict):
1728+
for mode_summary in summary.values():
1729+
if not isinstance(mode_summary, dict):
1730+
continue
1731+
candidates.append(mode_summary.get("transcriptionNormalizedAccuracy"))
17241732
payload_metrics = payload.get("metrics")
17251733
if isinstance(payload_metrics, dict):
17261734
candidates.extend(
@@ -1729,6 +1737,8 @@ def _score_from_saved_result(result_path: Path, metrics: dict[str, Any]) -> floa
17291737
payload_metrics.get("accuracy"),
17301738
payload_metrics.get("pass_rate"),
17311739
payload_metrics.get("eval/pass_rate"),
1740+
payload_metrics.get("pass_at_1"),
1741+
payload_metrics.get("transcriptionNormalizedAccuracy"),
17321742
]
17331743
)
17341744
candidates.extend(
@@ -1737,6 +1747,8 @@ def _score_from_saved_result(result_path: Path, metrics: dict[str, Any]) -> floa
17371747
metrics.get("accuracy"),
17381748
metrics.get("pass_rate"),
17391749
metrics.get("eval/pass_rate"),
1750+
metrics.get("pass_at_1"),
1751+
metrics.get("transcriptionNormalizedAccuracy"),
17401752
]
17411753
)
17421754
for candidate in candidates:

packages/examples/telegram/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Telegram Agent Examples
1+
# Telegram Agent Example
22

3-
Telegram bots using elizaOS with the full message pipeline (providers → LLM → actions → ALWAYS_AFTER hook actions).
3+
TypeScript Telegram bot using elizaOS with the full message pipeline
4+
(providers -> LLM -> actions -> ALWAYS_AFTER hook actions).
45

56
## Quick Start
67

@@ -10,17 +11,16 @@ export OPENAI_API_KEY="your-key"
1011
# Optional: export POSTGRES_URL="postgresql://..."
1112
```
1213

13-
| Language | Command |
14-
|----------|---------|
15-
| TypeScript | `cd typescript && bun install && bun run start` |
16-
| Python | `cd python && pip install -r requirements.txt && python telegram_agent.py` |
17-
| Rust | `cd rust/telegram-agent && cargo run --release` |
14+
```bash
15+
cd packages/examples/telegram
16+
bun install
17+
bun run start
18+
```
1819

1920
## How It Works
2021

21-
**TypeScript**: The `telegramPlugin` auto-integrates with the runtime - just include it and messages flow through the full pipeline automatically.
22-
23-
**Python/Rust**: Manually bridge Telegram to `runtime.message_service.handle_message()` which runs the full pipeline.
22+
The `telegramPlugin` auto-integrates with the runtime. Include it and messages
23+
flow through the full pipeline automatically.
2424

2525
## Message Pipeline
2626

packages/training/tests/rl/conftest.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
the package `rl` (relative imports inside it work).
1010
2. Installs sys.meta_path aliases mapping `src` and `src.training` prefixes
1111
onto `rl`, so legacy test imports keep working without edits.
12+
3. Skips tests whose imported module needs an optional ML dep (torch,
13+
transformers, atroposlib, …) that isn't installed in the unit-test env.
14+
Those tests are still runnable when the `[train]` extras are installed.
1215
"""
1316

1417
from __future__ import annotations
@@ -20,6 +23,8 @@
2023
import types
2124
from pathlib import Path
2225

26+
import pytest
27+
2328
_SCRIPTS_DIR = Path(__file__).resolve().parent.parent.parent / "scripts"
2429
_RL_DIR = _SCRIPTS_DIR / "rl"
2530

@@ -55,8 +60,11 @@ def find_spec(self, fullname: str, path=None, target=None):
5560
target_name = f"rl.{leaf}"
5661
try:
5762
real = importlib.import_module(target_name)
58-
except ImportError:
59-
return None
63+
except ImportError as exc:
64+
pytest.skip(
65+
f"optional ML dep missing for {fullname}: {exc}",
66+
allow_module_level=True,
67+
)
6068
sys.modules[fullname] = real
6169
return real.__spec__
6270
return None
@@ -71,3 +79,20 @@ def exec_module(self, module): # noqa: D401
7179

7280

7381
sys.meta_path.insert(0, _RLAliasFinder())
82+
83+
84+
# Some tests `import torch` (or other heavy deps) at module-top, before any
85+
# alias-finder logic runs. Skip them at collection time when the dep is
86+
# missing so the unit suite stays green without `[train]` extras.
87+
_HEAVY_DEP_TESTS = {
88+
"test_local_inference.py": "transformers",
89+
"test_continuous_rl.py": "transformers",
90+
"test_lr_scheduler.py": "transformers",
91+
}
92+
93+
collect_ignore: list[str] = []
94+
for _file, _dep in _HEAVY_DEP_TESTS.items():
95+
try:
96+
importlib.import_module(_dep)
97+
except ImportError:
98+
collect_ignore.append(_file)

0 commit comments

Comments
 (0)