Open Roland-Du opened 1 year ago
After using the Tiny model for training, the saved model file is in pt format torch.save({"dims": asdict(dims), "model_state_dict": hf_state_dict}, "/root/tiny_v2.pt")
I am trying to convert the model to pt in jit format
import torch
model = torch.load('/root/tiny_v2.pt')
batch_size, channels, time = 32, 1, 16000
inputs = torch.rand(batch_size, channels, time)
traced_model = torch.jit.script(model, inputs)
torch.jit.save(traced_model, 'model_jit.pt')
/usr/local/lib64/python3.9/site-packages/torch/jit/_script.py:1241: UserWarning: optimize
is deprecated and has no effect. Use `with torch.jit.optimized_execution() instead
warnings.warn(
Traceback (most recent call last):
File "/home/duzg/asr/dzg.py", line 7, in
model https://huggingface.co/openai/whisper-large-v2