Skip to content
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

Added code to allow users to specify inference parameters for Huggingface models using HuggingfaceInferenceAPI #15680

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AkashParua
Copy link

@AkashParua AkashParua commented Aug 27, 2024

Description

This PR is related to issue #15659 - I added code to allow users to specify inference parameters for Huggingface models using HuggingfaceInferenceAPI . Refer to link to see how this code integrates with huggingface.

Fixes #15659

New Package?

Did I fill in the tool.llamahub section in the pyproject.toml and provide a detailed README.md for my new integration or package?

  • Yes
  • No

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)

  • Yes
  • No

Type of Change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • I stared at the code and made sure it makes sense

Suggested Checklist:

  • I have performed a self-review of my own code

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 27, 2024
"The value of the stop parameter to use when generating text. This parameter"
" is used to stop generating text when one of the specified tokens is generated."
),
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

None of these parameters are used though? Seems like there needs to be some function to get model kwargs when using the client?

Copy link
Author

Choose a reason for hiding this comment

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

Yes! Sorry for the oversight. Correct me if I am wrong - link - here we can add these extra arguments. I am new to open-source contributions, I would really appreciate some guidance.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, not in the metadata, but I think these options need to be passed when using the clients, like here

output: "ConversationalOutput" = self._sync_client.conversational(

Probably we want a helper function to gather up the kwargs, and then each time a client is used, that function can help gather all the kwargs and send them along

Copy link
Author

Choose a reason for hiding this comment

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

Working on it! Thanks !

@logan-markewich logan-markewich self-assigned this Aug 28, 2024
@AkashParua AkashParua marked this pull request as draft August 29, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Specify inference parameters for Huggingface models using HuggingfaceInferenceAPI
2 participants