Skip to content

[Conversational snippet] Fix, refactor, & add tests #1003

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 6 commits into from
Nov 4, 2024

Conversation

mishig25
Copy link
Collaborator

@mishig25 mishig25 commented Oct 30, 2024

Description

[Conversational snippet] Fix, refactor, & add tests

closes #1010

  1. Fixes an error https://github.com/huggingface/huggingface.js/pull/1003/files#r1824269481
  2. Redo https://github.com/huggingface/huggingface.js/pull/1003/files#r1824270922
  3. Add tests

@mishig25 mishig25 marked this pull request as draft October 30, 2024 15:38
@@ -128,6 +128,7 @@ const modelInputSnippets: {
"tabular-classification": inputsTabularPrediction,
"text-classification": inputsTextClassification,
"text-generation": inputsTextGeneration,
"image-text-to-text": inputsTextGeneration,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this fix was needed, which caused an error on the hub. slack context.

I've created tests files for snippets that test the snippets for both LLMs & VLMs

});

return opts.start + messagesStringified.join(opts.sep) + opts.end;
export function stringifyMessages(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

redo stringifyMessages function to be cleaner

@mishig25 mishig25 marked this pull request as ready for review October 31, 2024 11:04
@mishig25
Copy link
Collaborator Author

mishig25 commented Oct 31, 2024

@Wauplin @julien-c, this PR is ready to be reviewed

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

lgtm from a very very superficial glance, but i didn't look in detail so i'll let someone else review

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

lgtm from a very very superficial glance, but i didn't look in detail so i'll let someone else review

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Thanks @mishig25! Looks good, I think we can merge it + make a patch release. Glad we now have tests for the snippets 👍

@mishig25 mishig25 merged commit ea047d1 into main Nov 4, 2024
5 checks passed
@mishig25 mishig25 deleted the conversational_snippets_update branch November 4, 2024 15:23
Wauplin added a commit that referenced this pull request Nov 14, 2024
Supersedes #994.

This PR adds an `huggingface_hub` snippet for `text-to-image` inference
in Python. I added a test as done in
#1003.

Once this one is approved and merged, I'll move on with all other tasks
that the `InferenceClient` supports.

---------

Co-authored-by: Mishig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrong chat snippet for image-text-to-text task
4 participants