Unverified Commit d8ce53a8 authored by Emin Demirci's avatar Emin Demirci Committed by GitHub
Browse files

Fix loaded_token reference before definition (#3523)

parent d114d80f
...@@ -682,6 +682,7 @@ class TextualInversionLoaderMixin: ...@@ -682,6 +682,7 @@ class TextualInversionLoaderMixin:
state_dict = torch.load(model_file, map_location="cpu") state_dict = torch.load(model_file, map_location="cpu")
# 2. Load token and embedding correcly from file # 2. Load token and embedding correcly from file
loaded_token = None
if isinstance(state_dict, torch.Tensor): if isinstance(state_dict, torch.Tensor):
if token is None: if token is None:
raise ValueError( raise ValueError(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment