googleapis / nodejs-vertexai

Apache License 2.0
96 stars 30 forks source link

Support Fine Tuned Models from Vertex AI #202

Open theredsix opened 4 months ago

theredsix commented 4 months ago

Vertex AI supports custom models by fine tuning PaLM2 and the Python library has support for accessing these custom models like below:

import vertexai
from vertexai.language_models import TextGenerationModel

vertexai.init(project="1032674713011", location="us-central1")
parameters = {
    "candidate_count": 1,
    "max_output_tokens": 1024,
    "temperature": 0.9,
    "top_p": 1
}
model = TextGenerationModel.from_pretrained("text-bison@002")
model = model.get_tuned_model("projects/1032674713011/locations/us-central1/models/8723892491658461184")
response = model.predict(
    """asdfasdf""",
    **parameters
)
print(f"Response from Model: {response.text}")

Request: Extend the nodejs library so it has the ability to call fine tuned models.

ankero commented 2 months ago

+1 on this, currently you cannot call tuned Gemini models with this library.

kevin36524 commented 2 months ago

I did raise a PR like https://github.com/googleapis/nodejs-vertexai/pull/310 . Kindly review and merge it.

juanicortesl commented 1 month ago

+1 please add support for this!

claidler commented 1 month ago

+1 Please!