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
File size: 375 Bytes
132a7e5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #!/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")
|