Skip to content

Commit c1cb943

Browse files
committed
change to ai.generate
1 parent ebf95e3 commit c1cb943

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

bigframes/operations/blob.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -974,21 +974,23 @@ def audio_transcribe(
974974

975975
prompt_text = "**Task:** Transcribe the provided audio. **Instructions:** - Your response must contain only the verbatim transcription of the audio. - Do not include any introductory text, summaries, or conversational filler in your response. The output should begin directly with the first word of the audio."
976976

977-
# Convert the audio series to the runtime representation required by the model.
978-
audio_runtime = audio_series.blob._get_runtime("R", with_metadata=True)
979-
977+
# Use bbq.ai.generate() to transcribe audio
980978
transcribed_results = bbq.ai.generate(
981-
prompt=(prompt_text, audio_runtime),
979+
prompt=(prompt_text, audio_series),
982980
connection_id=connection,
983981
endpoint=model_name,
984-
model_params={"generationConfig": {"temperature": 0.0}},
982+
request_type="unspecified",
985983
)
986984

985+
transcribed_content_series = transcribed_results.struct.field("result").rename(
986+
"transcribed_content"
987+
)
987988
transcribed_content_series = transcribed_results.struct.field("result").rename(
988989
"transcribed_content"
989990
)
990991

991992
if verbose:
993+
transcribed_status_series = transcribed_results.struct.field("status")
992994
transcribed_status_series = transcribed_results.struct.field("status")
993995
results_df = bpd.DataFrame(
994996
{

tests/system/large/blob/test_function.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@ def test_blob_transcribe(
768768
)
769769
.to_pandas()
770770
)
771+
print(actual)
771772

772773
# check relative length
773774
expected_text = "Now, as all books not primarily intended as picture-books consist principally of types composed to form letterpress"

0 commit comments

Comments
 (0)