Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Naive finetuning #93

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,38 @@ poetry run python app.py
3. Use it via [Hugging Face](https://huggingface.co/metavoiceio)
4. [Google Collab Demo](https://colab.research.google.com/github/metavoiceio/metavoice-src/blob/main/colab_demo.ipynb)

## Finetuning
We support finetuning the first stage LLM (see [Architecture section](#Architecture)).

In order to finetune, we expect a "|"-delimited CSV dataset of the following format:

```csv
audio_files|captions
./data/audio.wav|./data/caption.txt
```

Note that we don't perform any dataset overlap checks, so ensure that your train and val datasets are disjoint.

Try it out using our sample datasets via:
```bash
poetry run finetune --train ./datasets/sample_dataset.csv --val ./datasets/sample_val_dataset.csv
```

### Configuration

In order to set hyperparameters such as learning rate, what to freeze, etc, you
can edit the [finetune_params.py](./fam/llm/config/finetune_params.py) file.

We've got a light & optional integration with W&B that can be enabled via setting
`wandb_log = True` & by installing the appropriate dependencies.

```bash
poetry install -E observable
```

## Upcoming
- [x] Faster inference ⚡
- [ ] Fine-tuning code
- [x] Fine-tuning code 📐
- [ ] Synthesis of arbitrary length text


Expand Down
1 change: 1 addition & 0 deletions data/caption.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please call Stella.
321 changes: 321 additions & 0 deletions datasets/sample_dataset.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,321 @@
audio_files|captions
Copy link
Contributor Author

@lucapericlp lucapericlp Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opted to omit from git lfs to avoid setup complexity (since we don't really gain much)

./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
./data/audio.wav|./data/caption.txt
Loading