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 9
9
*
10
10
* This script is meant only for debug purposes.
11
11
*/
12
-
13
12
import { python , curl , js } from "../src/snippets/index" ;
14
13
import type { InferenceSnippet , ModelDataMinimal } from "../src/snippets/types" ;
15
- import minimist from "minimist " ;
14
+ import type { PipelineType } from "../src/pipelines " ;
16
15
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
+ ) ;
18
25
19
26
const accessToken = "hf_**********" ;
20
- const pipelineTag = args [ "pipeline-tag" ] || "text-generation" ;
27
+ const pipelineTag = ( args [ "pipeline-tag" ] || "text-generation" ) as PipelineType ;
21
28
const tags = ( args [ "tags" ] || "" ) . split ( "," ) ;
22
29
23
30
const modelMinimal : ModelDataMinimal = {
You can’t perform that action at this time.
0 commit comments