Skip to content

Commit f286a8a

Browse files
committed
use endpointUrl
1 parent 4983bc7 commit f286a8a

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

packages/inference/src/snippets/templates/js/huggingface.js/basic.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44

55
const output = await client.{{ methodName }}({
66
{% if endpointUrl %}
7-
endpointUrl: "{{ baseUrl }}",
7+
endpointUrl: "{{ endpointUrl }}",
88
{% endif %}
99
model: "{{ model.id }}",
1010
inputs: {{ inputs.asObj.inputs }},

packages/inference/src/snippets/templates/js/huggingface.js/basicAudio.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const data = fs.readFileSync({{inputs.asObj.inputs}});
66

77
const output = await client.{{ methodName }}({
88
{% if endpointUrl %}
9-
endpointUrl: "{{ baseUrl }}",
9+
endpointUrl: "{{ endpointUrl }}",
1010
{% endif %}
1111
data,
1212
model: "{{ model.id }}",

packages/inference/src/snippets/templates/js/huggingface.js/basicImage.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const data = fs.readFileSync({{inputs.asObj.inputs}});
66

77
const output = await client.{{ methodName }}({
88
{% if endpointUrl %}
9-
endpointUrl: "{{ baseUrl }}",
9+
endpointUrl: "{{ endpointUrl }}",
1010
{% endif %}
1111
data,
1212
model: "{{ model.id }}",

packages/inference/src/snippets/templates/js/huggingface.js/conversational.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44

55
const chatCompletion = await client.chatCompletion({
66
{% if endpointUrl %}
7-
endpointUrl: "{{ baseUrl }}",
7+
endpointUrl: "{{ endpointUrl }}",
88
{% endif %}
99
provider: "{{ provider }}",
1010
model: "{{ model.id }}",

packages/inference/src/snippets/templates/js/huggingface.js/conversationalStream.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let out = "";
66

77
const stream = client.chatCompletionStream({
88
{% if endpointUrl %}
9-
endpointUrl: "{{ baseUrl }}",
9+
endpointUrl: "{{ endpointUrl }}",
1010
{% endif %}
1111
provider: "{{ provider }}",
1212
model: "{{ model.id }}",

packages/inference/src/snippets/templates/js/huggingface.js/textToImage.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44

55
const image = await client.textToImage({
66
{% if endpointUrl %}
7-
endpointUrl: "{{ baseUrl }}",
7+
endpointUrl: "{{ endpointUrl }}",
88
{% endif %}
99
provider: "{{ provider }}",
1010
model: "{{ model.id }}",

packages/inference/src/snippets/templates/js/huggingface.js/textToSpeech.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44

55
const audio = await client.textToSpeech({
66
{% if endpointUrl %}
7-
endpointUrl: "{{ baseUrl }}",
7+
endpointUrl: "{{ endpointUrl }}",
88
{% endif %}
99
provider: "{{ provider }}",
1010
model: "{{ model.id }}",

packages/inference/src/snippets/templates/js/huggingface.js/textToVideo.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44

55
const video = await client.textToVideo({
66
{% if endpointUrl %}
7-
endpointUrl: "{{ baseUrl }}",
7+
endpointUrl: "{{ endpointUrl }}",
88
{% endif %}
99
provider: "{{ provider }}",
1010
model: "{{ model.id }}",

0 commit comments

Comments
 (0)