Skip to content

Instantly share code, notes, and snippets.

View Deep-unlearning's full-sized avatar

Steven Zheng Deep-unlearning

View GitHub Profile
@Deep-unlearning
Deep-unlearning / try_moonshine.py
Last active January 21, 2025 12:34
Use moonshine on transformers
from transformers import AutoProcessor, MoonshineForConditionalGeneration
from datasets import load_dataset
processor = AutoProcessor.from_pretrained("UsefulSensors/moonshine-tiny")
model = MoonshineForConditionalGeneration.from_pretrained("UsefulSensors/moonshine-tiny")
ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
inputs = processor([ds[0]["audio"]["array"], ds[0]["audio"]["array"]], return_tensors="pt")
input_values = inputs.input_values