You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Switched CLI parsing from positional args to getopt
- Added num_steps
- Added output file name
- Added audio lenght in seconds
Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Copy file name to clipboardExpand all lines: kleidiai-examples/audiogen/app/README.md
+54-56Lines changed: 54 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,57 @@ This guide will show you how to build the <strong>audio generation (audiogen)</s
21
21
22
22
To build the audiogen application, follow one the following sections depending on your <strong>TARGET</strong> platform:
23
23
24
-
-[Build the audiogen app for Android™ (TARGET)](#build-the-audiogen-app-on-linux_host_or-macos_host_for-android_target)
25
24
-[Build the audiogen app for macOS® (TARGET)](#build-the-audiogen-app-on-macos_host_for-macos_target)
25
+
-[Build the audiogen app for Android™ (TARGET)](#build-the-audiogen-app-on-linux_host_or-macos_host_for-android_target)
26
+
27
+
### Build the audiogen app on macOS® (HOST) for macOS® (TARGET)
28
+
29
+
#### Step 1
30
+
Navigate to the `audiogen/app/` folder. Set the `LITERT_MODELS_PATH` environment variable to the path where your Stable Audio Open Small models exported to LiteRT are located:
Build the audiogen application. Inside the `app` directory, create the `build` folder and navigate into it:
38
+
39
+
```bash
40
+
mkdir build &&cd build
41
+
```
42
+
43
+
Next, run CMake using the following command:
44
+
45
+
```bash
46
+
cmake ..
47
+
```
48
+
49
+
Then, build the application:
50
+
```bash
51
+
make -j
52
+
```
53
+
54
+
#### Step 3
55
+
Since the tokenizer used in the audiogen application is based on <strong>SentencePiece</strong>, you’ll need to download the `spiece.model` file from: https://huggingface.co/google-t5/t5-base/tree/main
At this point, you are ready to run the audiogen application.
63
+
64
+
From there, you can then run the `audiogen` application, which requires just three input arguments:
65
+
66
+
-**Model Path (-m)**: The directory containing your LiteRT models and `spiece.model` files
67
+
-**Prompt (-p)**: A text description of the desired audio (e.g., *warm arpeggios on house beats 120BPM with drums effect*)
68
+
-**CPU Threads (-t)**: The number of CPU threads to use (e.g., `4`)
69
+
70
+
```bash
71
+
./audiogen -m . -p "warm arpeggios on house beats 120BPM with drums effect" -t 4
72
+
```
73
+
74
+
If everything runs successfully, the generated audio will be saved in `.wav` format (`output.wav`) in the `audiogen_app` folder. At this point, you can play it on your laptop or PC.
26
75
27
76
### Build the audiogen app on Linux® (HOST) or macOS® (HOST) for Android™ (TARGET)
28
77
@@ -111,67 +160,16 @@ cd /data/local/tmp/app
111
160
112
161
From there, you can then run the `audiogen` application, which requires just three input arguments:
113
162
114
-
-**Model Path**: The directory containing your LiteRT models and `spiece.model` files
115
-
-**Prompt**: A text description of the desired audio (e.g., *warm arpeggios on house beats 120BPM with drums effect*)
116
-
-**CPU Threads**: The number of CPU threads to use (e.g., `4`)
117
-
-**Seed**: Specifies the seed value for the random initializer. Changing the seed will produce different audio outputs
163
+
-**Model Path (-m)**: The directory containing your LiteRT models and `spiece.model` files
164
+
-**Prompt (-p)**: A text description of the desired audio (e.g., *warm arpeggios on house beats 120BPM with drums effect*)
165
+
-**CPU Threads (-t)**: The number of CPU threads to use (e.g., `4`)
118
166
119
167
```bash
120
-
./audiogen ."warm arpeggios on house beats 120BPM with drums effect" 4
168
+
./audiogen -m . -p "warm arpeggios on house beats 120BPM with drums effect" -t 4
121
169
```
122
170
123
171
If everything runs successfully, the generated audio will be saved in `.wav` format (`output.wav`) in the same directory as the `audiogen` binary. At this point, you can then retrieve it using the `adb` tool from a different Terminal and play it on your laptop or PC.
124
172
125
173
```bash
126
174
adb pull data/local/tmp/output.wav
127
175
```
128
-
129
-
### Build the audiogen app on macOS® (HOST) for macOS® (TARGET)
130
-
131
-
#### Step 1
132
-
Navigate to the `audiogen/app/` folder. Set the `LITERT_MODELS_PATH` environment variable to the path where your Stable Audio Open Small models exported to LiteRT are located:
Build the audiogen application. Inside the `app` directory, create the `build` folder and navigate into it:
140
-
141
-
```bash
142
-
mkdir build &&cd build
143
-
```
144
-
145
-
Next, run CMake using the following command:
146
-
147
-
```bash
148
-
cmake ..
149
-
```
150
-
151
-
Then, build the application:
152
-
```bash
153
-
make -j
154
-
```
155
-
156
-
#### Step 3
157
-
Since the tokenizer used in the audiogen application is based on <strong>SentencePiece</strong>, you’ll need to download the `spiece.model` file from: https://huggingface.co/google-t5/t5-base/tree/main
At this point, you are ready to run the audiogen application.
165
-
166
-
From there, you can then run the `audiogen` application, which requires just three input arguments:
167
-
168
-
-**Model Path**: The directory containing your LiteRT models and `spiece.model` files
169
-
-**Prompt**: A text description of the desired audio (e.g., *warm arpeggios on house beats 120BPM with drums effect*)
170
-
-**CPU Threads**: The number of CPU threads to use (e.g., `4`, `8`)
171
-
-**Seed**: Specifies the seed value for the random initializer. Changing the seed will produce different audio outputs
172
-
173
-
```bash
174
-
./audiogen $LITERT_MODELS_PATH"warm arpeggios on house beats 120BPM with drums effect" 4 99
175
-
```
176
-
177
-
If everything runs successfully, the generated audio will be saved in `.wav` format (`output.wav`) in the `audiogen_app` folder. At this point, you can play it on your laptop or PC.
0 commit comments