mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
Apply suggestions from code review
This commit is contained in:
parent
6a25c14f46
commit
b5790224a5
@ -150,15 +150,16 @@ def download_weights(
|
|||||||
if not extension == ".safetensors" or not auto_convert:
|
if not extension == ".safetensors" or not auto_convert:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
# Try to load as a local PEFT model
|
else:
|
||||||
try:
|
# Try to load as a local PEFT model
|
||||||
utils.download_and_unload_peft(
|
try:
|
||||||
model_id, revision, trust_remote_code=trust_remote_code
|
utils.download_and_unload_peft(
|
||||||
)
|
model_id, revision, trust_remote_code=trust_remote_code
|
||||||
utils.weight_files(model_id, revision, extension)
|
)
|
||||||
return
|
utils.weight_files(model_id, revision, extension)
|
||||||
except (utils.LocalEntryNotFoundError, utils.EntryNotFoundError):
|
return
|
||||||
pass
|
except (utils.LocalEntryNotFoundError, utils.EntryNotFoundError):
|
||||||
|
pass
|
||||||
|
|
||||||
# Try to see if there are local pytorch weights
|
# Try to see if there are local pytorch weights
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user