Instructions to use Lyndow/ExoWrist_Smolvla with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Piper
How to use Lyndow/ExoWrist_Smolvla with Piper:
# 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
Download code/intent_rack_demo/scripts/audit_teacher_reference.py from Lyndow/ExoWrist_Smolvla: direct link, hf CLI and curl.
- Browser
- Download file 5.14 kB
-
https://huggingface.co/Lyndow/ExoWrist_Smolvla/resolve/main/code/intent_rack_demo/scripts/audit_teacher_reference.py
- Command line
-
hf download hf://Lyndow/ExoWrist_Smolvla/code/intent_rack_demo/scripts/audit_teacher_reference.py
-
curl -L -o audit_teacher_reference.py https://huggingface.co/Lyndow/ExoWrist_Smolvla/resolve/main/code/intent_rack_demo/scripts/audit_teacher_reference.py
5.14 kB
| #!/usr/bin/env python3 | |
| """Strict read-only reference audit; a geometric controller is never a VLA result.""" | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| import numpy as np | |
| def audit_case(folder, specification, base_arguments): | |
| result = json.loads((folder / 'result.json').read_text()) | |
| trace = json.loads((folder / 'trace.json').read_text()) | |
| perception = json.loads((folder / 'perception.json').read_text()) | |
| task_path = folder / 'task_audit.json' | |
| task = json.loads(task_path.read_text()) if task_path.exists() else {} | |
| source_ok = (result.get('learned_action_policy') is False and result.get('forced_assist') is False | |
| and result.get('intent_mode') == 'hand_context_teacher' | |
| and result.get('external_task_request_sec') is None | |
| and result.get('initial_physics_state') is None) | |
| trigger = result.get('assistance_trigger_sim_sec') | |
| starts = [p['assistance'] for p in perception if p.get('assistance', {}).get('need_assist') is True | |
| and p['assistance'].get('forced') is False | |
| and p['assistance'].get('observation_complete') is True | |
| and p['assistance'].get('source') == 'learned_hand_state_and_rgb_geometry_teacher'] | |
| valid_start = bool(trigger is not None and any( | |
| -1e-8 <= trigger - row['timestamp_sec'] <= .2 + 1e-8 for row in starts)) | |
| negative_times = {p['hand_state_observation']['timestamp_sec'] for p in perception | |
| if p.get('assistance', {}).get('model_class') == 'NO_ASSIST' | |
| and p['assistance'].get('observation_complete') is True | |
| and p.get('hand_state_observation', {}).get('status') == 'READY'} | |
| commands = np.array([[row['target'][f'joint{i}'] for i in range(1, 7)] | |
| + [row['target']['gripper_joint1']] for row in trace]) | |
| drift = float(np.abs(commands - commands[0]).max()) if len(commands) else None | |
| clean = bool(trace and result.get('failure') is None | |
| and result.get('coupling_under_0_5mm_all_physics_steps') | |
| and result.get('additional_contact_audit', {}).get('no_unexpected_contacts_observed')) | |
| expected = specification['expected_assist'] | |
| declared_steps = {**base_arguments, **specification['arguments']}['steps'] | |
| return {'case': folder.name, 'expected_assist': expected, 'source_contract_passed': source_ok, | |
| 'visual_start_verified': valid_start, 'trigger_sec': trigger, | |
| 'full_teacher_task_passed': bool(expected and source_ok and valid_start and clean | |
| and task.get('simulation_task_checks_pass')), | |
| 'correct_no_assistance': bool(not expected and source_ok and clean and trigger is None | |
| and len(negative_times) >= 2 and drift < 1e-10 | |
| and len(trace) == declared_steps), | |
| 'negative_complete_observation_count': len(negative_times), 'max_command_drift': drift, | |
| 'clean_physics': clean, 'physical_task_audit': task, 'result_failure': result.get('failure'), | |
| 'vla_action_model_used': False, 'real_hardware_tested': False} | |
| def main(): | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument('--root', type=Path, required=True) | |
| args = parser.parse_args() | |
| manifest = json.loads((args.root / 'manifest.json').read_text()) | |
| batch = json.loads((args.root / 'results.json').read_text()) | |
| if not batch.get('all_cases_completed') or len(batch['cases']) != len(manifest['cases']): | |
| raise ValueError('all declared cases must finish before reporting the reference result') | |
| completed = {row['name']: row for row in batch['cases']} | |
| if len(completed) != len(manifest['cases']) or set(completed) != {row['name'] for row in manifest['cases']}: | |
| raise ValueError('completed cases differ from the declared manifest') | |
| cases = [] | |
| for row in manifest['cases']: | |
| record = audit_case(args.root / row['name'], row, manifest['base_arguments']) | |
| record['returncode'] = completed[row['name']]['returncode'] | |
| if record['returncode'] != 0: | |
| record['full_teacher_task_passed'] = record['correct_no_assistance'] = False | |
| cases.append(record) | |
| summary = {'cases': cases, 'positive_cases': sum(row['expected_assist'] for row in cases), | |
| 'positive_full_task_passed': sum(row['full_teacher_task_passed'] for row in cases), | |
| 'negative_cases': sum(not row['expected_assist'] for row in cases), | |
| 'negative_correct_hold': sum(row['correct_no_assistance'] for row in cases), | |
| 'all_cases_completed': True, 'vla_action_model_used': False, | |
| 'independent_generalization_evaluation': False, 'current_vla_training_used_these_rollouts': False, | |
| 'real_hardware_tested': False} | |
| (args.root / 'teacher_reference_audit.json').write_text(json.dumps(summary, indent=2)) | |
| print(json.dumps({key: value for key, value in summary.items() if key != 'cases'})) | |
| if __name__ == '__main__': | |
| main() | |