nox-th / transformpt.py
lumindrive's picture
Upload folder using huggingface_hub
a3bc2f8 verified
raw
history blame contribute delete
605 Bytes
from transformers import WhisperForConditionalGeneration
import torch
model = WhisperForConditionalGeneration.from_pretrained(".")
processor = WhisperProcessor.from_pretrained("C:/Project/Private/AudioRecord/Spiritbox/Pro/whisper-thai-finetuned/checkpoint-500")
example_input = torch.randn(1, 80, 3000)
traced = torch.jit.trace(model, example_input)
traced.save("whisper_thai_traced.pt")
model.save_pretrained("C:/Project/Private/AudioRecord/Spiritbox/Pro/whisper-thai-finetuned/export")
processor.save_pretrained("C:/Project/Private/AudioRecord/Spiritbox/Pro/whisper-thai-finetuned/export")