File tree Expand file tree Collapse file tree 8 files changed +8
-8
lines changed
packages/inference/src/snippets/templates/js/huggingface.js Expand file tree Collapse file tree 8 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44
55const output = await client.{{ methodName }}({
66{% if endpointUrl %}
7- endpointUrl: "{{ baseUrl }}",
7+ endpointUrl: "{{ endpointUrl }}",
88{% endif %}
99 model: "{{ model.id }}",
1010 inputs: {{ inputs.asObj.inputs }},
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const data = fs.readFileSync({{inputs.asObj.inputs}});
66
77const output = await client.{{ methodName }}({
88{% if endpointUrl %}
9- endpointUrl: "{{ baseUrl }}",
9+ endpointUrl: "{{ endpointUrl }}",
1010{% endif %}
1111 data,
1212 model: "{{ model.id }}",
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const data = fs.readFileSync({{inputs.asObj.inputs}});
66
77const output = await client.{{ methodName }}({
88{% if endpointUrl %}
9- endpointUrl: "{{ baseUrl }}",
9+ endpointUrl: "{{ endpointUrl }}",
1010{% endif %}
1111 data,
1212 model: "{{ model.id }}",
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44
55const chatCompletion = await client.chatCompletion({
66{% if endpointUrl %}
7- endpointUrl: "{{ baseUrl }}",
7+ endpointUrl: "{{ endpointUrl }}",
88{% endif %}
99 provider: "{{ provider }}",
1010 model: "{{ model.id }}",
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ let out = "";
66
77const stream = client.chatCompletionStream({
88{% if endpointUrl %}
9- endpointUrl: "{{ baseUrl }}",
9+ endpointUrl: "{{ endpointUrl }}",
1010{% endif %}
1111 provider: "{{ provider }}",
1212 model: "{{ model.id }}",
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44
55const image = await client.textToImage({
66{% if endpointUrl %}
7- endpointUrl: "{{ baseUrl }}",
7+ endpointUrl: "{{ endpointUrl }}",
88{% endif %}
99 provider: "{{ provider }}",
1010 model: "{{ model.id }}",
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44
55const audio = await client.textToSpeech({
66{% if endpointUrl %}
7- endpointUrl: "{{ baseUrl }}",
7+ endpointUrl: "{{ endpointUrl }}",
88{% endif %}
99 provider: "{{ provider }}",
1010 model: "{{ model.id }}",
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const client = new InferenceClient("{{ accessToken }}");
44
55const video = await client.textToVideo({
66{% if endpointUrl %}
7- endpointUrl: "{{ baseUrl }}",
7+ endpointUrl: "{{ endpointUrl }}",
88{% endif %}
99 provider: "{{ provider }}",
1010 model: "{{ model.id }}",
You can’t perform that action at this time.
0 commit comments