Skip to content

Fix client in VLM JS inference snippet #1013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/tasks/src/snippets/js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const snippetTextGeneration = (
if (streaming) {
return [
{
client: "huggingface_hub",
client: "huggingface.js",
Copy link
Collaborator

@mishig25 mishig25 Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, not this? @huggingface/inference because we use like

import { HfInference } from "@huggingface/inference"
const client = new HfInference("hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let @coyotte508 decide what the best name is between huggingface.js and @huggingface/inference

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is the huggingface.js shown?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here: https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct?inference_api=true
Go to "JavaScript". At the moment it's huggingface_hub. In this PR I changed it to huggingface.js but happy to change it to @huggingface/inference if it's better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think huggingface.js is good

content: `import { HfInference } from "@huggingface/inference"

const client = new HfInference("${accessToken || `{API_TOKEN}`}")
Expand Down Expand Up @@ -108,7 +108,7 @@ for await (const chunk of stream) {
} else {
return [
{
client: "huggingface_hub",
client: "huggingface.js",
content: `import { HfInference } from '@huggingface/inference'

const client = new HfInference("${accessToken || `{API_TOKEN}`}")
Expand Down
Loading