File size: 381 Bytes
1a8ba2f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import subprocess
import sys
# Install bitsandbytes first
subprocess.check_call([sys.executable, "-m", "pip", "install", "bitsandbytes"])
# Then import and use your model
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model = AutoModelForCausalLM.from_pretrained(
"EdysorEdutech/gatewaytrainedmodel",
load_in_4bit=True,
device_map="auto"
) |