Run this model with HF Jobs
Run okuparinen/SKN_300m_simple 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/okuparinen/SKN_300m_simple. 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/okuparinen/SKN_300m_simple 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 okuparinen/SKN_300m_simple with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use okuparinen/SKN_300m_simple with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="okuparinen/SKN_300m_simple")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForCTC processor = AutoProcessor.from_pretrained("okuparinen/SKN_300m_simple") model = AutoModelForCTC.from_pretrained("okuparinen/SKN_300m_simple", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files22 unmodified lines23242526272829303122 unmodified lines## How to Get Started with the ModelUse the code below to get started with the model.TBA### Training Data22 unmodified lines232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686922 unmodified lines## How to Get Started with the Model```from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC, Wav2Vec2CTCTokenizerfrom datasets import Dataset, Audioimport torchimport pandas as pdds = pd.read_csv('CSV_DATA.csv')ds = ds.dropna(how='any', axis=0)test = Dataset.from_pandas(skn_test)test = test.cast_column("AUDIO_PATH_COLUMN", Audio(sampling_rate=16000))tokenizer = Wav2Vec2CTCTokenizer.from_pretrained("okuparinen/SKN_300m_simple", unk_token="[UNK]", pad_token="[PAD]", word_delimiter_token="|")model = Wav2Vec2ForCTC.from_pretrained("okuparinen/SKN_300m_simple").to("cuda")processor = Wav2Vec2Processor.from_pretrained("okuparinen/SKN_300m_simple", tokenizer=tokenizer)def prepare_dataset(batch):audio = batch["AUDIO_PATH"]batch["input_values"] = processor(audio["array"], sampling_rate=audio["sampling_rate"]).input_values[0]batch["input_length"] = len(batch["input_values"])return batchtest_ready = test.map(prepare_dataset, remove_columns=test.column_names)length = len(test)predictions = []for i in range(0, length, 1):input_dict = processor(test_ready[i]["input_values"], return_tensors="pt", padding=True)logits = model(input_dict.input_values.to("cuda")).logitspred_ids = torch.argmax(logits, dim=-1)[0]prediction = processor.decode(pred_ids)predictions.append(prediction)with open("OUTFILE.txt", "w") as f_pred:for line in predictions:f_pred.write(line + '\n')```### Training Data
README.md+40-2