fix: load tokenizer from base repo for quant venv compat
Merged model has tokenizer_class=TokenizersBackend (transformers 5.x) which is unknown to transformers 4.57.6 in the quant venv.
This commit is contained in:
+5
-1
@@ -13,9 +13,13 @@ from llmcompressor import oneshot
|
|||||||
MODEL = "/workspace/substrate-qwen36-27b-merged"
|
MODEL = "/workspace/substrate-qwen36-27b-merged"
|
||||||
OUTPUT = "/workspace/substrate-qwen36-27b-awq"
|
OUTPUT = "/workspace/substrate-qwen36-27b-awq"
|
||||||
CALIB_DATA = "/workspace/substrate_v5.jsonl"
|
CALIB_DATA = "/workspace/substrate_v5.jsonl"
|
||||||
|
# Merged model was saved with transformers 5.5.0 which writes
|
||||||
|
# tokenizer_class=TokenizersBackend — unknown to 4.57.6 in the quant venv.
|
||||||
|
# Load tokenizer from original repo (has standard class name).
|
||||||
|
TOKENIZER_SOURCE = "Qwen/Qwen3.6-27B"
|
||||||
|
|
||||||
print("Loading tokenizer...")
|
print("Loading tokenizer...")
|
||||||
tokenizer = AutoTokenizer.from_pretrained(MODEL)
|
tokenizer = AutoTokenizer.from_pretrained(TOKENIZER_SOURCE)
|
||||||
|
|
||||||
print("Loading model...")
|
print("Loading model...")
|
||||||
model = AutoModelForCausalLM.from_pretrained(
|
model = AutoModelForCausalLM.from_pretrained(
|
||||||
|
|||||||
Reference in New Issue
Block a user