@@ -12,9 +12,9 @@ describe("inference API snippets", () => {
12
12
} ;
13
13
const snippet = getJsInferenceSnippet ( model , "api_token" ) as InferenceSnippet [ ] ;
14
14
15
- expect ( snippet [ 0 ] . content ) . toEqual ( `import { HfInference } from "@huggingface/inference"
15
+ expect ( snippet [ 0 ] . content ) . toEqual ( `import { HfInference } from "@huggingface/inference";
16
16
17
- const client = new HfInference("api_token")
17
+ const client = new HfInference("api_token");
18
18
19
19
let out = "";
20
20
@@ -47,9 +47,9 @@ for await (const chunk of stream) {
47
47
} ;
48
48
const snippet = getJsInferenceSnippet ( model , "api_token" , { streaming : false } ) as InferenceSnippet [ ] ;
49
49
50
- expect ( snippet [ 0 ] . content ) . toEqual ( `import { HfInference } from "@huggingface/inference"
50
+ expect ( snippet [ 0 ] . content ) . toEqual ( `import { HfInference } from "@huggingface/inference";
51
51
52
- const client = new HfInference("api_token")
52
+ const client = new HfInference("api_token");
53
53
54
54
const chatCompletion = await client.chatCompletion({
55
55
model: "meta-llama/Llama-3.1-8B-Instruct",
@@ -74,9 +74,9 @@ console.log(chatCompletion.choices[0].message);`);
74
74
} ;
75
75
const snippet = getJsInferenceSnippet ( model , "api_token" ) as InferenceSnippet [ ] ;
76
76
77
- expect ( snippet [ 0 ] . content ) . toEqual ( `import { HfInference } from "@huggingface/inference"
77
+ expect ( snippet [ 0 ] . content ) . toEqual ( `import { HfInference } from "@huggingface/inference";
78
78
79
- const client = new HfInference("api_token")
79
+ const client = new HfInference("api_token");
80
80
81
81
let out = "";
82
82
@@ -120,9 +120,9 @@ for await (const chunk of stream) {
120
120
} ;
121
121
const snippet = getJsInferenceSnippet ( model , "api_token" ) as InferenceSnippet [ ] ;
122
122
123
- expect ( snippet [ 0 ] . content ) . toEqual ( `import { HfInference } from "@huggingface/inference"
123
+ expect ( snippet [ 0 ] . content ) . toEqual ( `import { HfInference } from "@huggingface/inference";
124
124
125
- const client = new HfInference("api_token")
125
+ const client = new HfInference("api_token");
126
126
127
127
let out = "";
128
128
0 commit comments