Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/bigframes/bigframes/bigquery/_operations/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ def _convert_series(
result = convert.to_bf_series(s, default_index=None, session=session)

if result.dtype == dtypes.OBJ_REF_DTYPE:
# Support multimodel
# Support multimodal
return result.blob.read_url()
return result

Expand Down
4 changes: 2 additions & 2 deletions packages/bigframes/bigframes/operations/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def map(
bigframes.series.Series,
model.predict(
df,
prompt=self._make_multimodel_prompt(
prompt=self._make_multimodal_prompt(
df, columns, user_instruction, output_instruction
),
temperature=0.0,
Expand Down Expand Up @@ -774,7 +774,7 @@ def _attach_embedding(dataframe, source_column: str, embedding_column: str, mode
return result_df

@staticmethod
def _make_multimodel_prompt(
def _make_multimodal_prompt(
prompt_df, columns, user_instruction: str, output_instruction: str
):
prompt = [f"{output_instruction}\n{user_instruction}\nContext: "]
Expand Down
6 changes: 3 additions & 3 deletions packages/bigframes/bigframes/operations/semantics.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def filter(self, instruction: str, model, ground_with_google_search: bool = Fals
bigframes.dataframe.DataFrame,
model.predict(
df,
prompt=self._make_multimodel_prompt(
prompt=self._make_multimodal_prompt(
df, columns, user_instruction, output_instruction
),
temperature=0.0,
Expand Down Expand Up @@ -518,7 +518,7 @@ def map(
bigframes.series.Series,
model.predict(
df,
prompt=self._make_multimodel_prompt(
prompt=self._make_multimodal_prompt(
df, columns, user_instruction, output_instruction
),
temperature=0.0,
Expand Down Expand Up @@ -1094,7 +1094,7 @@ def _attach_embedding(dataframe, source_column: str, embedding_column: str, mode
return result_df

@staticmethod
def _make_multimodel_prompt(
def _make_multimodal_prompt(
prompt_df, columns, user_instruction: str, output_instruction: str
):
prompt = [f"{output_instruction}\n{user_instruction}\nContext: "]
Expand Down
6 changes: 3 additions & 3 deletions packages/bigframes/tests/system/large/operations/test_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_filter_multi_model(session, gemini_flash_model):
10,
):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*", name="image"
"gs://bigframes-dev-testing/a_multimodal/images/*", name="image"
Comment thread
shuoweil marked this conversation as resolved.
)
df["prey"] = series.Series(
["building", "cross road", "rock", "squirrel", "rabbit"], session=session
Expand Down Expand Up @@ -229,7 +229,7 @@ def test_map(session, gemini_flash_model, output_schema, output_col):
)


def test_map_multimodel(session, gemini_flash_model):
def test_map_multimodal(session, gemini_flash_model):
with bigframes.option_context(
AI_OP_EXP_OPTION,
True,
Expand All @@ -239,7 +239,7 @@ def test_map_multimodel(session, gemini_flash_model):
10,
):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*", name="image"
"gs://bigframes-dev-testing/a_multimodal/images/*", name="image"
)
df["scenario"] = series.Series(
["building", "cross road", "tree", "squirrel", "rabbit"], session=session
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def test_filter_multi_model(session, gemini_flash_model):
10,
):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*", name="image"
"gs://bigframes-dev-testing/a_multimodal/images/*", name="image"
Comment thread
shuoweil marked this conversation as resolved.
)
df["prey"] = series.Series(
["building", "cross road", "rock", "squirrel", "rabbit"], session=session
Expand Down Expand Up @@ -571,7 +571,7 @@ def test_map(session, gemini_flash_model):
)


def test_map_multimodel(session, gemini_flash_model):
def test_map_multimodal(session, gemini_flash_model):
with bigframes.option_context(
SEM_OP_EXP_OPTION,
True,
Expand All @@ -581,7 +581,7 @@ def test_map_multimodel(session, gemini_flash_model):
10,
):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*", name="image"
"gs://bigframes-dev-testing/a_multimodal/images/*", name="image"
)
df["scenario"] = series.Series(
["building", "cross road", "tree", "squirrel", "rabbit"], session=session
Expand Down
12 changes: 6 additions & 6 deletions packages/bigframes/tests/system/small/bigquery/test_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_ai_generate_bool(session):

def test_ai_generate_bool_multi_model(session):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*", name="image"
"gs://bigframes-dev-testing/a_multimodal/images/*", name="image"
Comment thread
shuoweil marked this conversation as resolved.
)

result = bbq.ai.generate_bool((df["image"], " contains an animal"))
Expand Down Expand Up @@ -197,7 +197,7 @@ def test_ai_generate_int(session):

def test_ai_generate_int_multi_model(session):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*", name="image"
"gs://bigframes-dev-testing/a_multimodal/images/*", name="image"
)

result = bbq.ai.generate_int(
Expand Down Expand Up @@ -236,7 +236,7 @@ def test_ai_generate_double(session):

def test_ai_generate_double_multi_model(session):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*", name="image"
"gs://bigframes-dev-testing/a_multimodal/images/*", name="image"
)

result = bbq.ai.generate_double(
Expand Down Expand Up @@ -307,7 +307,7 @@ def test_ai_if(session):

def test_ai_if_multi_model(session, bq_connection):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*",
"gs://bigframes-dev-testing/a_multimodal/images/*",
name="image",
connection=bq_connection,
)
Expand Down Expand Up @@ -338,7 +338,7 @@ def test_ai_classify_with_examples(session):

def test_ai_classify_multi_model(session, bq_connection):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*",
"gs://bigframes-dev-testing/a_multimodal/images/*",
name="image",
connection=bq_connection,
)
Expand All @@ -361,7 +361,7 @@ def test_ai_score(session):

def test_ai_score_multi_model(session):
df = session.from_glob_path(
"gs://bigframes-dev-testing/a_multimodel/images/*", name="image"
"gs://bigframes-dev-testing/a_multimodal/images/*", name="image"
)
prompt = ("Rank the liveliness of ", df["image"], "on the scale from 1 to 3")

Expand Down
Loading