Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: llm palm score tests #643

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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions 11 tests/system/load/test_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

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.

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

curious how much run time reduction with sampling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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)
Expand All @@ -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")

Expand All @@ -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
Expand All @@ -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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.