Spaces:
Paused
Paused
Murat commited on
Commit ·
d10bc40
1
Parent(s): aa12eca
Upload whisper_tests.livemd
Browse files
public-apps/whisper_tests.livemd
CHANGED
|
@@ -17,18 +17,18 @@ Mix.install(
|
|
| 17 |
## Section
|
| 18 |
|
| 19 |
```elixir
|
| 20 |
-
language = Kino.Input.select("Select Language", en: "English", tr: "Turkish")
|
| 21 |
```
|
| 22 |
|
| 23 |
<!-- livebook:{"reevaluate_automatically":true} -->
|
| 24 |
|
| 25 |
```elixir
|
| 26 |
-
{:ok, model_info} = Bumblebee.load_model({:hf, "openai/whisper-
|
| 27 |
-
{:ok, featurizer} = Bumblebee.load_featurizer({:hf, "openai/whisper-
|
| 28 |
-
{:ok, tokenizer} = Bumblebee.load_tokenizer({:hf, "openai/whisper-
|
| 29 |
|
| 30 |
{:ok, generation_config} =
|
| 31 |
-
Bumblebee.load_generation_config({:hf, "openai/whisper-
|
| 32 |
|
| 33 |
generation_config = Bumblebee.configure(generation_config, max_new_tokens: 100)
|
| 34 |
|
|
@@ -38,14 +38,14 @@ generation_config = Bumblebee.configure(generation_config, max_new_tokens: 100)
|
|
| 38 |
|
| 39 |
# end)
|
| 40 |
|
| 41 |
-
lang = Kino.Input.read(language)
|
| 42 |
-
|
| 43 |
serving =
|
| 44 |
Bumblebee.Audio.speech_to_text_whisper(model_info, featurizer, tokenizer, generation_config,
|
| 45 |
compile: [batch_size: 30],
|
| 46 |
defn_options: [compiler: EXLA],
|
| 47 |
-
|
| 48 |
-
|
|
|
|
| 49 |
)
|
| 50 |
```
|
| 51 |
|
|
|
|
| 17 |
## Section
|
| 18 |
|
| 19 |
```elixir
|
| 20 |
+
# language = Kino.Input.select("Select Language", en: "English", tr: "Turkish")
|
| 21 |
```
|
| 22 |
|
| 23 |
<!-- livebook:{"reevaluate_automatically":true} -->
|
| 24 |
|
| 25 |
```elixir
|
| 26 |
+
{:ok, model_info} = Bumblebee.load_model({:hf, "openai/whisper-tiny"})
|
| 27 |
+
{:ok, featurizer} = Bumblebee.load_featurizer({:hf, "openai/whisper-tiny"})
|
| 28 |
+
{:ok, tokenizer} = Bumblebee.load_tokenizer({:hf, "openai/whisper-tiny"})
|
| 29 |
|
| 30 |
{:ok, generation_config} =
|
| 31 |
+
Bumblebee.load_generation_config({:hf, "openai/whisper-tiny"})
|
| 32 |
|
| 33 |
generation_config = Bumblebee.configure(generation_config, max_new_tokens: 100)
|
| 34 |
|
|
|
|
| 38 |
|
| 39 |
# end)
|
| 40 |
|
| 41 |
+
# lang = Kino.Input.read(language)
|
|
|
|
| 42 |
serving =
|
| 43 |
Bumblebee.Audio.speech_to_text_whisper(model_info, featurizer, tokenizer, generation_config,
|
| 44 |
compile: [batch_size: 30],
|
| 45 |
defn_options: [compiler: EXLA],
|
| 46 |
+
# ,
|
| 47 |
+
chunk_num_seconds: 30
|
| 48 |
+
# language: Atom.to_string(lang)
|
| 49 |
)
|
| 50 |
```
|
| 51 |
|