[Core] Support dynamically loading Lora adapter from HuggingFace (#6234)

Co-authored-by: Antoni Baum <antoni.baum@protonmail.com>
This commit is contained in:
Jiaxin Shan
2024-07-22 15:42:40 -07:00
committed by GitHub
parent 69d5ae38dc
commit 42c7f66a38
11 changed files with 201 additions and 18 deletions

View File

@@ -137,14 +137,13 @@ def get_lora_tokenizer(lora_request: LoRARequest, *args,
if lora_request is None:
return None
try:
tokenizer = get_tokenizer(lora_request.lora_local_path, *args,
**kwargs)
tokenizer = get_tokenizer(lora_request.lora_path, *args, **kwargs)
except OSError as e:
# No tokenizer was found in the LoRA folder,
# use base model tokenizer
logger.warning(
"No tokenizer found in %s, using base model tokenizer instead. "
"(Exception: %s)", lora_request.lora_local_path, e)
"(Exception: %s)", lora_request.lora_path, e)
tokenizer = None
return tokenizer