Run this model with HF Jobs
Run patrickvonplaten/wav2vec2_tiny_random_robust on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/patrickvonplaten/wav2vec2_tiny_random_robust. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/patrickvonplaten/wav2vec2_tiny_random_robust on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use patrickvonplaten/wav2vec2_tiny_random_robust with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use patrickvonplaten/wav2vec2_tiny_random_robust with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="patrickvonplaten/wav2vec2_tiny_random_robust")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("patrickvonplaten/wav2vec2_tiny_random_robust") model = AutoModel.from_pretrained("patrickvonplaten/wav2vec2_tiny_random_robust", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
a2c418f
1
Parent(s): e095fe6
Create README.md
Browse files123456789101112131415161718192021222324252627282930## Test model
To test this model run the following code:
```pythonfrom datasets import load_datasetfrom transformers import Wav2Vec2ForCTCimport torchaudioimport torch
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
model = Wav2Vec2ForCTC.from_pretrained("patrickvonplaten/wav2vec2_tiny_random_robust")
def load_audio(batch): batch["samples"], _ = torchaudio.load(batch["file"]) return batch ds = ds.map(load_audio)
input_ids = torch.nn.utils.rnn.pad_sequence([torch.tensor(x[0]) for x in ds["samples"][:10]], batch_first=True)
# forwardlogits = model(input_ids).logitspred_ids = torch.argmax(logits, dim=-1)
# dummy lossdummy_labels = torch.zeros((logits.shape[0], logits.shape[0] - 10))loss = model(input_ids, labels=dummy_labels).loss```README.mdAdded+30