File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed
inference/src/snippets/templates/js/huggingface.js
tasks-gen/snippets-fixtures
conversational-llm-stream/js/huggingface.js
conversational-vlm-stream/js/huggingface.js Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
4
4
5
5
let out = "";
6
6
7
- const stream = await client.chatCompletionStream({
7
+ const stream = client.chatCompletionStream({
8
8
provider: "{{ provider }}",
9
9
model: "{{ model.id }}",
10
10
{{ inputs.asTsString }}
@@ -17,5 +17,5 @@ for await (const chunk of stream) {
17
17
const newContent = chunk.choices[0].delta.content;
18
18
out += newContent;
19
19
console.log(newContent);
20
- }
20
+ }
21
21
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("api_token");
4
4
5
5
let out = "" ;
6
6
7
- const stream = await client . chatCompletionStream ( {
7
+ const stream = client . chatCompletionStream ( {
8
8
provider : "hf-inference" ,
9
9
model : "meta-llama/Llama-3.1-8B-Instruct" ,
10
10
messages : [
@@ -21,5 +21,5 @@ for await (const chunk of stream) {
21
21
const newContent = chunk . choices [ 0 ] . delta . content ;
22
22
out += newContent ;
23
23
console . log ( newContent ) ;
24
- }
24
+ }
25
25
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("api_token");
4
4
5
5
let out = "" ;
6
6
7
- const stream = await client . chatCompletionStream ( {
7
+ const stream = client . chatCompletionStream ( {
8
8
provider : "together" ,
9
9
model : "meta-llama/Llama-3.1-8B-Instruct" ,
10
10
messages : [
@@ -21,5 +21,5 @@ for await (const chunk of stream) {
21
21
const newContent = chunk . choices [ 0 ] . delta . content ;
22
22
out += newContent ;
23
23
console . log ( newContent ) ;
24
- }
24
+ }
25
25
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("api_token");
4
4
5
5
let out = "" ;
6
6
7
- const stream = await client . chatCompletionStream ( {
7
+ const stream = client . chatCompletionStream ( {
8
8
provider : "fireworks-ai" ,
9
9
model : "meta-llama/Llama-3.2-11B-Vision-Instruct" ,
10
10
messages : [
@@ -32,5 +32,5 @@ for await (const chunk of stream) {
32
32
const newContent = chunk . choices [ 0 ] . delta . content ;
33
33
out += newContent ;
34
34
console . log ( newContent ) ;
35
- }
35
+ }
36
36
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("api_token");
4
4
5
5
let out = "" ;
6
6
7
- const stream = await client . chatCompletionStream ( {
7
+ const stream = client . chatCompletionStream ( {
8
8
provider : "hf-inference" ,
9
9
model : "meta-llama/Llama-3.2-11B-Vision-Instruct" ,
10
10
messages : [
@@ -32,5 +32,5 @@ for await (const chunk of stream) {
32
32
const newContent = chunk . choices [ 0 ] . delta . content ;
33
33
out += newContent ;
34
34
console . log ( newContent ) ;
35
- }
35
+ }
36
36
}
You can’t perform that action at this time.
0 commit comments