Skip to content

feat: support fit() in GeminiTextGenerator #758

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

Merged
merged 4 commits into from
Jun 6, 2024

Conversation

ashleyxuu
Copy link
Contributor

@ashleyxuu ashleyxuu commented Jun 5, 2024

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes internal #343765747🦕

@ashleyxuu ashleyxuu requested a review from GarrettWu June 5, 2024 23:35
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Jun 5, 2024
@ashleyxuu ashleyxuu changed the title feat: support score() in GeminiTextGenerator feat: support fit() in GeminiTextGenerator Jun 5, 2024
@ashleyxuu ashleyxuu marked this pull request as ready for review June 6, 2024 17:00
@ashleyxuu ashleyxuu requested review from a team as code owners June 6, 2024 17:00
model_name="gemini-pro", max_iterations=1
)

df = llm_fine_tune_df_default_index.dropna().sample(n=100)
Copy link
Contributor

Choose a reason for hiding this comment

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

don't need to dropna and sample after #760

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks

X, y = utils.convert_to_dataframe(X, y)

options = self._bqml_options
options["endpoint"] = "gemini-1.0-pro-002"
Copy link
Contributor

Choose a reason for hiding this comment

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

Spill out the model version to be used for tuning in docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our model name is "gemini-pro-1.0", but their endpoint is called "gemini-1.0-pro-002". Any ideas for how to spill out it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GeminiTextGenerator: Fitted estimator.
"""
if self._bqml_model.model_name.startswith("gemini-1.5"):
raise NotImplementedError("Fit is not supported for gemini-1.5 model.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Also mention supported model types in docs.

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.

@ashleyxuu ashleyxuu added the automerge Merge the pull request once unit tests and other checks pass. label Jun 6, 2024
@gcf-merge-on-green gcf-merge-on-green bot merged commit d751f5c into main Jun 6, 2024
22 of 23 checks passed
@gcf-merge-on-green gcf-merge-on-green bot deleted the ashleyxu-fine-tune-gemini branch June 6, 2024 19:20
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants