mirror of
https://github.com/huggingface/lerobot.git
synced 2026-06-02 11:51:25 +00:00
Fix default version to v2.1 for vizualizer
This commit is contained in:
@@ -10,6 +10,8 @@ import { pick } from "@/utils/pick";
|
||||
const DATASET_URL =
|
||||
process.env.DATASET_URL || "https://huggingface.co/datasets";
|
||||
|
||||
const DEFAULT_REVISION = "v2.1";
|
||||
|
||||
const SERIES_NAME_DELIMITER = " | ";
|
||||
|
||||
export async function getEpisodeData(
|
||||
@@ -20,7 +22,7 @@ export async function getEpisodeData(
|
||||
const repoId = `${org}/${dataset}`;
|
||||
try {
|
||||
const episode_chunk = Math.floor(0 / 1000);
|
||||
const jsonUrl = `${DATASET_URL}/${repoId}/resolve/main/meta/info.json`;
|
||||
const jsonUrl = `${DATASET_URL}/${repoId}/resolve/${DEFAULT_REVISION}/meta/info.json`;
|
||||
|
||||
const info = await fetchJson<DatasetMetadata>(jsonUrl);
|
||||
|
||||
@@ -56,7 +58,7 @@ export async function getEpisodeData(
|
||||
});
|
||||
return {
|
||||
filename: key,
|
||||
url: `${DATASET_URL}/${repoId}/resolve/main/` + videoPath,
|
||||
url: `${DATASET_URL}/${repoId}/resolve/${DEFAULT_REVISION}/` + videoPath,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -103,7 +105,7 @@ export async function getEpisodeData(
|
||||
});
|
||||
|
||||
const parquetUrl =
|
||||
`${DATASET_URL}/${repoId}/resolve/main/` +
|
||||
`${DATASET_URL}/${repoId}/resolve/${DEFAULT_REVISION}/` +
|
||||
formatStringWithVars(info.data_path, {
|
||||
episode_chunk: episode_chunk.toString().padStart(3, "0"),
|
||||
episode_index: episodeId.toString().padStart(6, "0"),
|
||||
|
||||
@@ -38,6 +38,9 @@ export default async function ExplorePage({
|
||||
return <div className="p-8 text-red-600">Failed to load datasets.</div>;
|
||||
}
|
||||
|
||||
// Default to v2.1 revision for dataset loading
|
||||
const DEFAULT_REVISION = "v2.1";
|
||||
|
||||
// Fetch episode 0 data for each dataset
|
||||
const datasetWithVideos = (
|
||||
await Promise.all(
|
||||
@@ -45,7 +48,7 @@ export default async function ExplorePage({
|
||||
try {
|
||||
const [org, dataset] = ds.id.split("/");
|
||||
const repoId = `${org}/${dataset}`;
|
||||
const jsonUrl = `https://huggingface.co/datasets/${repoId}/resolve/main/meta/info.json`;
|
||||
const jsonUrl = `https://huggingface.co/datasets/${repoId}/resolve/${DEFAULT_REVISION}/meta/info.json`;
|
||||
const info = await fetchJson<DatasetMetadata>(jsonUrl);
|
||||
const videoEntry = Object.entries(info.features).find(
|
||||
([key, value]) => value.dtype === "video",
|
||||
@@ -59,7 +62,7 @@ export default async function ExplorePage({
|
||||
episode_index: "0".padStart(6, "0"),
|
||||
});
|
||||
const url =
|
||||
`https://huggingface.co/datasets/${repoId}/resolve/main/` +
|
||||
`https://huggingface.co/datasets/${repoId}/resolve/${DEFAULT_REVISION}/` +
|
||||
videoPath;
|
||||
// Check if videoUrl exists (status 200)
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user