update web_demo

This commit is contained in:
yangapku
2023-08-10 21:47:23 +08:00
parent 867879545f
commit 2e5cff6454
5 changed files with 123 additions and 94 deletions

View File

@@ -38,7 +38,7 @@ Commands:
def _load_model_tokenizer(args):
tokenizer = AutoTokenizer.from_pretrained(
args.checkpoint_path, trust_remote_code=True,
args.checkpoint_path, trust_remote_code=True, resume_download=True,
)
if args.cpu_only:
@@ -50,9 +50,11 @@ def _load_model_tokenizer(args):
args.checkpoint_path,
device_map=device_map,
trust_remote_code=True,
resume_download=True,
).eval()
model.generation_config = GenerationConfig.from_pretrained(args.checkpoint_path, trust_remote_code=True)
model.generation_config = GenerationConfig.from_pretrained(
args.checkpoint_path, trust_remote_code=True, resume_download=True,
)
return model, tokenizer