File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 99 *
1010 * This script is meant only for debug purposes.
1111 */
12-
1312import { python , curl , js } from "../src/snippets/index" ;
1413import 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
1926const accessToken = "hf_**********" ;
20- const pipelineTag = args [ "pipeline-tag" ] || "text-generation" ;
27+ const pipelineTag = ( args [ "pipeline-tag" ] || "text-generation" ) as PipelineType ;
2128const tags = ( args [ "tags" ] || "" ) . split ( "," ) ;
2229
2330const modelMinimal : ModelDataMinimal = {
You can’t perform that action at this time.
0 commit comments