Skip to content

Commit 9aff171

Browse files
authored
chore: lower the sem ops temperature to 0 to reduce randomness (#1098)
1 parent 62a88e8 commit 9aff171

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bigframes/operations/semantics.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def agg(
193193

194194
# Run model
195195
predict_df = typing.cast(
196-
bigframes.dataframe.DataFrame, model.predict(prompt_s)
196+
bigframes.dataframe.DataFrame, model.predict(prompt_s, temperature=0.0)
197197
)
198198
agg_df[column] = predict_df["ml_generate_text_llm_result"].combine_first(
199199
single_row_df
@@ -344,7 +344,8 @@ def filter(self, instruction: str, model):
344344
results = typing.cast(
345345
DataFrame,
346346
model.predict(
347-
self._make_prompt(columns, user_instruction, output_instruction)
347+
self._make_prompt(columns, user_instruction, output_instruction),
348+
temperature=0.0,
348349
),
349350
)
350351

@@ -418,7 +419,8 @@ def map(self, instruction: str, output_column: str, model):
418419
results = typing.cast(
419420
Series,
420421
model.predict(
421-
self._make_prompt(columns, user_instruction, output_instruction)
422+
self._make_prompt(columns, user_instruction, output_instruction),
423+
temperature=0.0,
422424
)["ml_generate_text_llm_result"],
423425
)
424426

@@ -776,7 +778,9 @@ def _topk_partition(
776778

777779
import bigframes.dataframe
778780

779-
predict_df = typing.cast(bigframes.dataframe.DataFrame, model.predict(prompt_s))
781+
predict_df = typing.cast(
782+
bigframes.dataframe.DataFrame, model.predict(prompt_s, temperature=0.0)
783+
)
780784

781785
marks = predict_df["ml_generate_text_llm_result"].str.contains("2")
782786
more_relavant: bigframes.dataframe.DataFrame = df[marks]

0 commit comments

Comments
 (0)