Skip to content

feat: add Gemini-pro-1.5 to GeminiTextGenerator Tuning and Support score() method in Gemini-pro-1.5 #1208

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 23 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
97d9259
docs(bigquery): update minor parts in base.py
shuoweil Dec 3, 2024
c9318d0
docs(bigquery): update minor changes for bigframes/ml/base.py
shuoweil Dec 3, 2024
4f9370c
Merge branch 'shuowei-doc-update'
shuoweil Dec 3, 2024
8d5e0ed
Merge branch 'shuowei-doc-update'
shuoweil Dec 3, 2024
e5413a1
Merge branch 'shuowei-update-textembedding005'
shuoweil Dec 3, 2024
7b65227
Merge branch 'shuowei-doc-update'
shuoweil Dec 3, 2024
9d6376b
Merge branch 'shuowei-update-textembedding005'
shuoweil Dec 3, 2024
f315f54
Merge branch 'shuowei-text-generator-tuning'
shuoweil Dec 10, 2024
e9f28f4
feat: Update lUpdate GeminiTextGenerator Tuning and Support score() m…
shuoweil Dec 11, 2024
5d2a807
feat: Update lUpdate GeminiTextGenerator Tuning and Support score() m…
shuoweil Dec 11, 2024
dc765ec
Merge branch 'main' into shuowei-text-generator-tuning
Dec 11, 2024
7a40315
Merge branch 'main' into shuowei-text-generator-tuning
Dec 11, 2024
8be16d3
update testcase and docs for better clarification
shuoweil Dec 11, 2024
8a39a02
update endpoint to corresponding endpoint for fine tuning.
shuoweil Dec 12, 2024
361a734
Merge branch 'main' into shuowei-text-generator-tuning
Dec 12, 2024
b213753
Merge branch 'main' into shuowei-text-generator-tuning
Dec 12, 2024
9de2c0e
docs(bigquery): update minor parts in base.py
shuoweil Dec 3, 2024
ed001b8
fix syntax issue
shuoweil Dec 12, 2024
9928f10
Revert "docs(bigquery): update minor parts in base.py"
shuoweil Dec 12, 2024
ba80d10
Merge branch 'main' into shuowei-text-generator-tuning
Dec 12, 2024
241ae73
merge gemini_fine_tune_endpoints and gemini_score_endpoints together,…
shuoweil Dec 13, 2024
205e173
merge genimi_fine_tune_endpoints and genimi_score_endpoints, since th…
shuoweil Dec 13, 2024
6a44e7b
Revert "merge genimi_fine_tune_endpoints and genimi_score_endpoints, …
shuoweil Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Update lUpdate GeminiTextGenerator Tuning and Support score() m…
…ethod in Gemini-pro-1.5 \n Bug: b/381936588 and b/344891364
  • Loading branch information
shuoweil committed Dec 11, 2024
commit 5d2a807186d6e65f1cd0bcdbee2ecc9770f63762
1 change: 1 addition & 0 deletions bigframes/ml/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,7 @@ def fit(
Returns:
GeminiTextGenerator: Fitted estimator.
"""
# Support gemini-1.5 and gemini-pro
Copy link
Contributor

Choose a reason for hiding this comment

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

move the consts to the top of the file for better organization.

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

supported_models = ["gemini-pro", "gemini-1.5-pro-002", "gemini-1.5-flash-002"]
if self.model_name not in supported_models:
raise NotImplementedError(
Expand Down
1 change: 0 additions & 1 deletion tests/system/load/test_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def test_llm_gemini_configure_fit(
],
index=3,
)
# TODO(ashleyxu b/335492787): After bqml rolled out version control: save, load, check parameters to ensure configuration was kept


@pytest.mark.flaky(retries=2)
Expand Down
3 changes: 2 additions & 1 deletion tests/system/small/ml/test_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def test_llm_palm_score_params(llm_fine_tune_df_default_index):
)


# test score() function for "gemini-pro" and "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.

nit: test name already indicates it. The comment seems redundant.

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

@pytest.mark.parametrize(
"model_name",
(
Expand All @@ -421,7 +422,7 @@ def test_llm_palm_score_params(llm_fine_tune_df_default_index):
"gemini-1.5-flash-002",
),
)
def test_llm_gemini_pro_score(model_name, llm_fine_tune_df_default_index):
def test_llm_gemini_score(llm_fine_tune_df_default_index, model_name):
Copy link
Contributor

Choose a reason for hiding this comment

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

add for next test "test_llm_gemini_pro_score_params" as well

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

model = llm.GeminiTextGenerator(model_name=model_name)

# Check score to ensure the model was fitted
Expand Down
Loading