This repository was archived by the owner on Apr 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
fix: llm palm score tests #643
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,12 +49,13 @@ def llm_remote_text_df(session, llm_remote_text_pandas_df): | |
| return session.read_pandas(llm_remote_text_pandas_df) | ||
|
|
||
|
|
||
| @pytest.mark.flaky(retries=2) | ||
| def test_llm_palm_configure_fit(llm_fine_tune_df_default_index, llm_remote_text_df): | ||
| model = bigframes.ml.llm.PaLM2TextGenerator( | ||
| model_name="text-bison", max_iterations=1 | ||
| ) | ||
|
|
||
| df = llm_fine_tune_df_default_index.dropna() | ||
| df = llm_fine_tune_df_default_index.dropna().sample(n=100) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. curious how much run time reduction with sampling.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It didn't improve much. It still takes the same amount of time around 30-40 mins, and the durations has some variations. |
||
| X_train = df[["prompt"]] | ||
| y_train = df[["label"]] | ||
| model.fit(X_train, y_train) | ||
|
|
@@ -70,6 +71,7 @@ def test_llm_palm_configure_fit(llm_fine_tune_df_default_index, llm_remote_text_ | |
| # TODO(ashleyxu b/335492787): After bqml rolled out version control: save, load, check parameters to ensure configuration was kept | ||
|
|
||
|
|
||
| @pytest.mark.flaky(retries=2) | ||
| def test_llm_palm_score(llm_fine_tune_df_default_index): | ||
| model = bigframes.ml.llm.PaLM2TextGenerator(model_name="text-bison") | ||
|
|
||
|
|
@@ -89,6 +91,7 @@ def test_llm_palm_score(llm_fine_tune_df_default_index): | |
| assert all(col in score_result_col for col in expected_col) | ||
|
|
||
|
|
||
| @pytest.mark.flaky(retries=2) | ||
| def test_llm_palm_score_params(llm_fine_tune_df_default_index): | ||
| model = bigframes.ml.llm.PaLM2TextGenerator( | ||
| model_name="text-bison", max_iterations=1 | ||
|
|
@@ -102,12 +105,10 @@ def test_llm_palm_score_params(llm_fine_tune_df_default_index): | |
| ).to_pandas() | ||
| score_result_col = score_result.columns.to_list() | ||
| expected_col = [ | ||
| "trial_id", | ||
| "precision", | ||
| "recall", | ||
| "accuracy", | ||
| "f1_score", | ||
| "log_loss", | ||
| "roc_auc", | ||
| "label", | ||
| "evaluation_status", | ||
| ] | ||
| assert all(col in score_result_col for col in expected_col) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 add retry for experimental features.
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.
Done.