Skip to content

Instantly share code, notes, and snippets.

View ir2718's full-sized avatar

ir2718

  • Zagreb, Croatia
  • 06:13 (UTC +02:00)
View GitHub Profile
# !pip install --upgrade onnx==1.17.0 onnxruntime==1.20.1 onnxslim==0.1.48 optimum==1.24.0 transformers==4.48.3
import torch
import torch.nn as nn
from transformers import AutoProcessor, AutoModelForCausalLM
import os
import onnxslim
from optimum.onnx.graph_transformations import merge_decoders, check_and_save_model
model = AutoModelForCausalLM.from_pretrained(