Skip to content

Commit

Permalink
Merge pull request #102 from jjyaoao/jjy1
Browse files Browse the repository at this point in the history
Minor update to unit 4
  • Loading branch information
MKhalusova authored Jul 27, 2023
2 parents 57c3d79 + 2eff749 commit 360ba6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion chapters/en/chapter4/classification_models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ and verify this is correct:
```
from IPython.display import Audio
classifier(sample["audio"].copy())
Audio(sample["audio"]["array"], rate=sample["audio"]["sampling_rate"])
```

Expand Down Expand Up @@ -289,7 +290,7 @@ take that as our prediction. Let's confirm whether we were right by listening to
volume too high or else you might get a jump!):

```python
Audio(audio, rate=16000)
Audio(audio_sample, rate=16000)
```

Perfect! We have the sound of a dog barking 🐕, which aligns with the model's prediction. Have a play with different audio
Expand Down
5 changes: 4 additions & 1 deletion chapters/en/chapter4/fine-tuning.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ GTZAN doesn't provide a predefined validation set, so we'll have to create one o
genres, so we can use the `train_test_split()` method to quickly create a 90/10 split as follows:

```python
gtzan = gtzan["train"].train_test_split(seed=42, shuffle=True, test_size=0.1)
gtzan = gtzan.train_test_split(seed=42, shuffle=True, test_size=0.1)
gtzan
```

Expand Down Expand Up @@ -109,6 +109,9 @@ This label looks correct, since it matches the filename of the audio file. Let's
using Gradio to create a simple interface with the `Blocks` API:

```python
import gradio as gr


def generate_audio():
example = gtzan["train"].shuffle()[0]
audio = example["audio"]
Expand Down

0 comments on commit 360ba6c

Please sign in to comment.