Instructions to use AlexWortega/tinyvla with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use AlexWortega/tinyvla with LeRobot:
# 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
streaming: episodes_per_epoch worker lifetime cap (dataloader workers leaked to OOM-kill on multi-hour runs twice)
Browse files
tinyvla_b200/src/tinyvla/data/streaming_hub.py
CHANGED
|
@@ -67,6 +67,9 @@ class HubEpisodeStream(IterableDataset):
|
|
| 67 |
robot_prompts: dict | None = None, # morph_key -> str
|
| 68 |
support_cache_datasets: int = 8,
|
| 69 |
support_cache_size: int = 48,
|
|
|
|
|
|
|
|
|
|
| 70 |
):
|
| 71 |
super().__init__()
|
| 72 |
self.specs = specs
|
|
@@ -75,6 +78,7 @@ class HubEpisodeStream(IterableDataset):
|
|
| 75 |
self.robot_prompts = robot_prompts or {}
|
| 76 |
self.support_cache_datasets = support_cache_datasets
|
| 77 |
self.support_cache_size = support_cache_size
|
|
|
|
| 78 |
self.token = token
|
| 79 |
self.chunk = chunk
|
| 80 |
self.image_size = image_size
|
|
@@ -325,7 +329,9 @@ class HubEpisodeStream(IterableDataset):
|
|
| 325 |
item["support_actions"] = torch.stack(acts)
|
| 326 |
return item
|
| 327 |
|
| 328 |
-
|
|
|
|
|
|
|
| 329 |
si = rng.choices(range(len(self.specs)), weights=weights, k=1)[0]
|
| 330 |
try:
|
| 331 |
meta = self._load_meta(si)
|
|
@@ -351,3 +357,5 @@ class HubEpisodeStream(IterableDataset):
|
|
| 351 |
import logging
|
| 352 |
|
| 353 |
logging.warning(f"stream: skipping {self.specs[si]['repo_id']} ep after {type(e).__name__}: {e}")
|
|
|
|
|
|
|
|
|
| 67 |
robot_prompts: dict | None = None, # morph_key -> str
|
| 68 |
support_cache_datasets: int = 8,
|
| 69 |
support_cache_size: int = 48,
|
| 70 |
+
episodes_per_epoch: int = 200, # воркер завершает поток после N эпизодов:
|
| 71 |
+
# ограничивает жизнь процесса и любые
|
| 72 |
+
# медленные утечки (OOM-kill на длинных прогонах)
|
| 73 |
):
|
| 74 |
super().__init__()
|
| 75 |
self.specs = specs
|
|
|
|
| 78 |
self.robot_prompts = robot_prompts or {}
|
| 79 |
self.support_cache_datasets = support_cache_datasets
|
| 80 |
self.support_cache_size = support_cache_size
|
| 81 |
+
self.episodes_per_epoch = episodes_per_epoch
|
| 82 |
self.token = token
|
| 83 |
self.chunk = chunk
|
| 84 |
self.image_size = image_size
|
|
|
|
| 329 |
item["support_actions"] = torch.stack(acts)
|
| 330 |
return item
|
| 331 |
|
| 332 |
+
ep_count = 0
|
| 333 |
+
while self.episodes_per_epoch <= 0 or ep_count < self.episodes_per_epoch:
|
| 334 |
+
ep_count += 1
|
| 335 |
si = rng.choices(range(len(self.specs)), weights=weights, k=1)[0]
|
| 336 |
try:
|
| 337 |
meta = self._load_meta(si)
|
|
|
|
| 357 |
import logging
|
| 358 |
|
| 359 |
logging.warning(f"stream: skipping {self.specs[si]['repo_id']} ep after {type(e).__name__}: {e}")
|
| 360 |
+
rng.shuffle(buf)
|
| 361 |
+
yield from buf # эпоха воркера кончилась: дослать буфер и умереть чистым
|