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

Add support to parse VertexAI Model garden Llama2 model output #14718

Conversation

izo0x90
Copy link
Contributor

@izo0x90 izo0x90 commented Dec 14, 2023

  • Description: The output of Llama2 models in GCP VertexAI Model garden is not compatible with the generic VertexAiModelGarden handler class. This PR adds a class to handle/ properly parse the output returned by those models. The handler also adds support for storing/ passing parameters to the model that is consistent with the core VertexAI LLM models.

  • Dependencies: None

Copy link

vercel bot commented Dec 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jan 4, 2024 3:20pm

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Ɑ: models Related to LLMs or chat model modules 🤖:improvement Medium size change to existing code to handle new use-cases labels Dec 14, 2023
@izo0x90 izo0x90 changed the title Add support to parse Llama2 model output Add support to parse VertexAI Llama2 model output Dec 14, 2023
@izo0x90 izo0x90 changed the title Add support to parse VertexAI Llama2 model output Add support to parse VertexAI Model garden Llama2 model output Dec 14, 2023
@izo0x90
Copy link
Contributor Author

izo0x90 commented Dec 18, 2023

@baskaryan

@baskaryan
Copy link
Collaborator

thanks for contribution @izo0x90! the main vertexai integrations have moved to their own package in libs/partners/google-vertexai. any interest in porting this change over there?

cc @efriis @lkuligin

@baskaryan baskaryan added the 🔌: google Primarily related to Google GenAI or VertexAI integrations label Jan 29, 2024
@hwchase17 hwchase17 closed this Jan 30, 2024
@baskaryan baskaryan reopened this Jan 30, 2024
@izo0x90
Copy link
Contributor Author

izo0x90 commented Feb 2, 2024

thanks for contribution @izo0x90! the main vertexai integrations have moved to their own package in libs/partners/google-vertexai. any interest in porting this change over there?

cc @efriis @lkuligin

@baskaryan Yes absolutely if this has not been accomplished there already I would to love to make that change. Thanks.

@lkuligin
Copy link
Collaborator

lkuligin commented Feb 5, 2024

@izo0x90 could you share the exact error you're getting, please?

there's an integration tests for Llama and it seems to be working fine:

[("FALCON_ENDPOINT_ID", "generated_text"), ("LLAMA_ENDPOINT_ID", None)],

@izo0x90
Copy link
Contributor Author

izo0x90 commented Feb 27, 2024

@izo0x90 could you share the exact error you're getting, please?

there's an integration tests for Llama and it seems to be working fine:

[("FALCON_ENDPOINT_ID", "generated_text"), ("LLAMA_ENDPOINT_ID", None)],

Sorry for the tardy response, I finally had the time to create an update PR with the new location that houses this functionality. langchain-ai/langchain-google#41

As to why the test passes successfully, the core of the issue is that the generic class interprets each character of the Llama2 response as a "prediction" as such it created numerous Generation objects for each char of the response text. The test only checks if the "correct" objects are generated and the type of the response is string, which a singe letter of the response text satisfies, and the test technically passes, of course this is not what we actually need as an end user.

@izo0x90 izo0x90 closed this Feb 29, 2024
@izo0x90 izo0x90 deleted the hristo/vertex-model-garden-llama2-support branch February 29, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: google Primarily related to Google GenAI or VertexAI integrations 🤖:improvement Medium size change to existing code to handle new use-cases Ɑ: models Related to LLMs or chat model modules size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants