mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-10 09:03:02 +08:00
Update transcription drop action for audio files
This commit is contained in:
parent
b8fc4eefb5
commit
4d42202c83
1 changed files with 12 additions and 4 deletions
|
@ -351,20 +351,28 @@ defmodule Livebook.Runtime.Definitions do
|
|||
|
||||
#{if windows? do
|
||||
"""
|
||||
serving = Bumblebee.Audio.speech_to_text(model_info, featurizer, tokenizer, generation_config)\
|
||||
serving = Bumblebee.Audio.speech_to_text_whisper(model_info, featurizer, tokenizer, generation_config,
|
||||
chunk_num_seconds: 30,
|
||||
timestamps: :segments,
|
||||
compile: [batch_size: 4]
|
||||
)\
|
||||
"""
|
||||
else
|
||||
"""
|
||||
serving =
|
||||
Bumblebee.Audio.speech_to_text(model_info, featurizer, tokenizer, generation_config,
|
||||
compile: [batch_size: 1],
|
||||
Bumblebee.Audio.speech_to_text_whisper(model_info, featurizer, tokenizer, generation_config,
|
||||
chunk_num_seconds: 30,
|
||||
timestamps: :segments,
|
||||
compile: [batch_size: 4],
|
||||
defn_options: [compiler: EXLA]
|
||||
)\
|
||||
"""
|
||||
end}
|
||||
|
||||
path = Kino.FS.file_path("{{NAME}}")
|
||||
output = Nx.Serving.run(serving, {:file, path})\
|
||||
output = Nx.Serving.run(serving, {:file, path})
|
||||
|
||||
# output.chunks |> Enum.map_join(& &1.text) |> String.trim()\
|
||||
""",
|
||||
packages: [kino_bumblebee, nx_backend_package]
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue