Skip to content

Commit

Permalink
Fix PathLike model_id load.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Feb 18, 2025
1 parent 797c420 commit e1b4e34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/interface/ltp/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def LTP(
model_id = pretrained_model_name_or_path

revision = None
if len(model_id.split("@")) == 2:
if isinstance(model_id, str) and len(model_id.split("@")) == 2:
model_id, revision = model_id.split("@")

if os.path.isdir(model_id) and CONFIG_NAME in os.listdir(model_id):
Expand Down
2 changes: 1 addition & 1 deletion python/interface/ltp/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def from_pretrained(
model_id = pretrained_model_name_or_path

revision = None
if len(model_id.split("@")) == 2:
if isinstance(model_id, str) and len(model_id.split("@")) == 2:
model_id, revision = model_id.split("@")

if os.path.isdir(model_id) and CONFIG_NAME in os.listdir(model_id):
Expand Down

0 comments on commit e1b4e34

Please sign in to comment.