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

inference: Add model option to client #170

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

russellb
Copy link
Contributor

@russellb russellb commented Oct 2, 2024

I was running this client for testing purposes and being able to
specify which model to use is a convenient addition. This change makes
that possible.

Signed-off-by: Russell Bryant rbryant@redhat.com

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 2, 2024
@russellb russellb force-pushed the inference-client-model-choice branch from d58b2b6 to 1499006 Compare October 2, 2024 19:24
Copy link
Contributor

@ashwinb ashwinb left a comment

Choose a reason for hiding this comment

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

lg

messages=[message],
stream=stream,
)
async for log in EventLogger().log(iterator):
log.print()


async def run_mm_main(host: str, port: int, stream: bool, path: str):
async def run_mm_main(host: str, port: int, stream: bool, path: str, model: str):
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: (also existing issue) -- the typehint for both path and model should be Optional[str]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I noticed a warning because of that. I can go ahead and fix it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ashwinb added a fix for that to this PR

messages=[message],
stream=stream,
)
async for log in EventLogger().log(iterator):
log.print()


def main(host: str, port: int, stream: bool = True, mm: bool = False, file: str = None):
def main(host: str, port: int, stream: bool = True, mm: bool = False, file: Optional[str] = None, model: Optional[str] = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

could you run pre-commit? make sure you install it first

cd llama-stack
pip install pre-commit
pre-commit install

Then run git commit -a --amend (once this time) so it will run and run all the formatting lints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, yes, it's about time I install that!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

... and now with automation so you don't have to catch this yourself! #176

@russellb russellb force-pushed the inference-client-model-choice branch from da51106 to e91e9cc Compare October 3, 2024 13:45
I was running this client for testing purposes and being able to
specify which model to use is a convenient addition. This change makes
that possible.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
A couple of arguments were Optional string arguments, but not marked
as such. We were getting some warnings as a result.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
@russellb russellb force-pushed the inference-client-model-choice branch from e91e9cc to 242632a Compare October 3, 2024 13:46
@ashwinb ashwinb merged commit 06db921 into meta-llama:main Oct 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants