-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Vertex AI init commit #616
Conversation
Would it be cleaner to merge this change with existing dsp.modules.google? |
@Demontego |
Can you merge this PR? |
Thanks @Demontego ! @okhat will this need an update to |
dsp/modules/googlevertexai.py
Outdated
from vertexai.language_models import CodeGenerationModel, TextGenerationModel | ||
from vertexai.preview.generative_models import GenerativeModel | ||
except ImportError: | ||
print("Not loading VertexAI because it is not installed.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove the print statement here to avoid printing every time someone imports dspy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do it
For what its worth: I have been testing and using this integration already for some projects and it works fine for me. @Demontego , the title has a typo, which is why I wasn't able to find it when searching for it - could you fix that so others don't duplicate this integration? |
up |
Hi @Demontego I missed this before, but could you move the existing docs to the documentation folder as with the other LMs. Will be good to merge after that! |
dsp/modules/googlevertexai.py
Outdated
"""Wrapper around GoogleVertexAI's API. | ||
|
||
Currently supported models include `gemini-pro-1.0`. | ||
""" | ||
|
||
def __init__( | ||
self, model_name: str = "text-bison@002", **kwargs, | ||
): | ||
""" | ||
Parameters | ||
---------- | ||
model : str | ||
Which pre-trained model from Google to use? | ||
Choices are [`text-bison@002`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you clarify what the supported models are? Additionally, model
is not a parameter. model_name
is. This was confusing when I was using this code for a small demo project.
**self.kwargs, | ||
"temperature": 0.7, | ||
"max_output_tokens": 1024, | ||
"top_p": 1.0, | ||
"top_k": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these kwargs available for non-gemini models if they are set to defaults for non-gemini models?
I was using this PR for a small project, so I just wanted to give feedback. Thanks for writing this! |
@Demontego Can you please fix the typo on the title of this PR from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will open up possibilities for image RAG in dspy , in fact evals on image RAG in DSPy.
i'm currently initializing vertex outside DSPy for this reason.
deploying and finetuning using vertex is a large field to open up to optimizations using DSPY.
Hi @Demontego , just following up on this. PR is good to merge following this! |
Thanks @Demontego ! |
Thank you @Demontego! This is a great help for me :) your contribution is much appreciated |
This is the first phase of implementing google vertex ai in dspy. Please take a look. Write where and how best to correct, what else should be added.