mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
Fix missing trust_remote_code
flag for AutoTokenizer in utils.peft
Peft loading function was missing the `trust_remote_code=trust_remote_code` argument causing the custom tokenizer code to be not found.
This commit is contained in:
parent
8acdc1fae7
commit
b1581ccb55
@ -38,7 +38,7 @@ def download_and_unload_peft(model_id, revision, trust_remote_code):
|
|||||||
os.makedirs(model_id, exist_ok=True)
|
os.makedirs(model_id, exist_ok=True)
|
||||||
cache_dir = model_id
|
cache_dir = model_id
|
||||||
logger.info(f"Saving the newly created merged model to {cache_dir}")
|
logger.info(f"Saving the newly created merged model to {cache_dir}")
|
||||||
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
|
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=trust_remote_code)
|
||||||
model.save_pretrained(cache_dir, safe_serialization=True)
|
model.save_pretrained(cache_dir, safe_serialization=True)
|
||||||
model.config.save_pretrained(cache_dir)
|
model.config.save_pretrained(cache_dir)
|
||||||
tokenizer.save_pretrained(cache_dir)
|
tokenizer.save_pretrained(cache_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user