Skip to content

Instantly share code, notes, and snippets.

View imneonizer's full-sized avatar
:octocat:
Developing for the python community!

Nitin Rai imneonizer

:octocat:
Developing for the python community!
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(