Skip to content

Commit 05fad33

Browse files
committed
change to ai.generate
1 parent 62f7e9f commit 05fad33

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
@@ -816,21 +816,23 @@ def audio_transcribe(
816816

817817
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."
818818

819-
# Convert the audio series to the runtime representation required by the model.
820-
audio_runtime = audio_series.blob._get_runtime("R", with_metadata=True)
821-
819+
# Use bbq.ai.generate() to transcribe audio
822820
transcribed_results = bbq.ai.generate(
823-
prompt=(prompt_text, audio_runtime),
821+
prompt=(prompt_text, audio_series),
824822
connection_id=connection,
825823
endpoint=model_name,
826-
model_params={"generationConfig": {"temperature": 0.0}},
824+
request_type="unspecified",
827825
)
828826

827+
transcribed_content_series = transcribed_results.struct.field("result").rename(
828+
"transcribed_content"
829+
)
829830
transcribed_content_series = transcribed_results.struct.field("result").rename(
830831
"transcribed_content"
831832
)
832833

833834
if verbose:
835+
transcribed_status_series = transcribed_results.struct.field("status")
834836
transcribed_status_series = transcribed_results.struct.field("status")
835837
results_df = bpd.DataFrame(
836838
{

tests/system/large/blob/test_function.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ def test_blob_transcribe(
425425
)
426426
.to_pandas()
427427
)
428+
print(actual)
428429

429430
# check relative length
430431
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)