LeLab / src /lib /hubViewer.ts
GitHub CI
Sync from leLab @ 1894ab5ba1a73f8ecea4400426c272739494d104
c8cad77
Raw History Blame Contribute Delete
477 Bytes
/** Open a Hub dataset in the visualize_dataset Space (private ones go through the login redirect). */
export const openHubViewer = (repoId: string, isPrivate: boolean) => {
const spacePath = `/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${repoId}`)}`;
const target = isPrivate
? `https://huggingface.co/login?next=${encodeURIComponent(spacePath)}`
: `https://huggingface.co${spacePath}`;
window.open(target, "_blank", "noopener,noreferrer");
};