Download scripts/data/prepare_test_data.mjs from VoiceOfML/Search: direct link, hf CLI and curl.
- Browser
- Download file 805 Bytes
-
https://huggingface.co/spaces/VoiceOfML/Search/resolve/main/scripts/data/prepare_test_data.mjs
- Command line
-
hf download hf://spaces/VoiceOfML/Search/scripts/data/prepare_test_data.mjs
-
curl -L -o prepare_test_data.mjs https://huggingface.co/spaces/VoiceOfML/Search/resolve/main/scripts/data/prepare_test_data.mjs
805 Bytes
| import {resolve} from "node:path"; | |
| import {pathToFileURL} from "node:url"; | |
| import {ensureSearchGeneration} from "./fetch_search_generation.mjs"; | |
| export const DEFAULT_GENERATION = "5c80388b465f35f74711c17aef9e31f8bb1c04fc0553e9820ac271658d740639"; | |
| export async function prepareTestData(target = "data") { | |
| // An explicitly empty or invalid override must fail, not select the default. | |
| const generation = process.env.SEARCH_DATA_GENERATION ?? DEFAULT_GENERATION; | |
| return ensureSearchGeneration(generation, "space", target); | |
| } | |
| if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) { | |
| if (process.argv.length > 3) throw new Error("usage: node scripts/data/prepare_test_data.mjs [OUTPUT_DIR]"); | |
| console.log(JSON.stringify(await prepareTestData(process.argv[2]))); | |
| } | |