Instructions to use patrickvonplaten/wav2vec2_libri with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use patrickvonplaten/wav2vec2_libri with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForPreTraining processor = AutoProcessor.from_pretrained("patrickvonplaten/wav2vec2_libri") model = AutoModelForPreTraining.from_pretrained("patrickvonplaten/wav2vec2_libri", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download make_graph.py from patrickvonplaten/wav2vec2_libri: direct link, hf CLI and curl.
- Browser
- Download file 375 Bytes
-
https://huggingface.co/patrickvonplaten/wav2vec2_libri/resolve/main/make_graph.py
- Command line
-
hf download hf://patrickvonplaten/wav2vec2_libri/make_graph.py
-
curl -L -o make_graph.py https://huggingface.co/patrickvonplaten/wav2vec2_libri/resolve/main/make_graph.py
375 Bytes
| #!/usr/bin/env python3 | |
| import sys | |
| import matplotlib.pyplot as plt | |
| file_path = sys.argv[1] | |
| with open(file_path, "r") as f: | |
| lines = f.readlines() | |
| loss = [] | |
| key_word = "constrast_loss: " | |
| for line in lines: | |
| if key_word in line: | |
| loss.append(line.split(key_word)[-1].split("|")[0]) | |
| X = range(len(loss)) | |
| plt.plot(X, loss) | |
| plt.savefig(file_path + "_plot.png") | |