Download src/dispatch.ts from ebubar/teleop: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/ebubar/teleop/resolve/main/src/dispatch.ts
- Command line
-
hf download hf://spaces/ebubar/teleop/src/dispatch.ts
-
curl -L -o dispatch.ts https://huggingface.co/spaces/ebubar/teleop/resolve/main/src/dispatch.ts
1.03 kB
| import { ReachyMini } from '@pollen-robotics/reachy-mini-sdk'; | |
| (window as unknown as { ReachyMini: typeof ReachyMini }).ReachyMini = ReachyMini; | |
| window.dispatchEvent(new Event('reachymini:ready')); | |
| const params = new URLSearchParams(location.search); | |
| if (params.get('embedded') === '1' || params.get('embed') === '1') { | |
| void import('./embed').catch(showError); | |
| } else { | |
| void import('@pollen-robotics/reachy-mini-sdk/host/auto').then(({ mountHost }) => { | |
| mountHost({ appName: 'Expressive Teleop', appIconUrl: `${import.meta.env.BASE_URL}icon.svg`, appEmoji: '🎮', enableMicrophone: false, | |
| devToken: import.meta.env.VITE_HF_TOKEN && import.meta.env.VITE_HF_USERNAME | |
| ? { token: import.meta.env.VITE_HF_TOKEN, userName: import.meta.env.VITE_HF_USERNAME } : undefined, | |
| clientId: import.meta.env.VITE_HF_OAUTH_CLIENT_ID, | |
| }); | |
| }).catch(showError); | |
| } | |
| function showError(error: unknown) { | |
| console.error(error); | |
| document.querySelector('#root')!.textContent = `Unable to start Teleop: ${String(error)}`; | |
| } | |