Skip to content

Commit b3deb60

Browse files
committed
no new deps
1 parent 3772f29 commit b3deb60

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

packages/tasks/scripts/check-snippets.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@
99
*
1010
* This script is meant only for debug purposes.
1111
*/
12-
1312
import { python, curl, js } from "../src/snippets/index";
1413
import type { InferenceSnippet, ModelDataMinimal } from "../src/snippets/types";
15-
import minimist from "minimist";
14+
import type { PipelineType } from "../src/pipelines";
1615

17-
const args = minimist(process.argv.slice(2));
16+
// Parse command-line arguments
17+
const args = process.argv.slice(2).reduce(
18+
(acc, arg) => {
19+
const [key, value] = arg.split("=");
20+
acc[key.replace("--", "")] = value;
21+
return acc;
22+
},
23+
{} as { [key: string]: string }
24+
);
1825

1926
const accessToken = "hf_**********";
20-
const pipelineTag = args["pipeline-tag"] || "text-generation";
27+
const pipelineTag = (args["pipeline-tag"] || "text-generation") as PipelineType;
2128
const tags = (args["tags"] || "").split(",");
2229

2330
const modelMinimal: ModelDataMinimal = {

0 commit comments

Comments
 (0)