Skip to content

Commit

Permalink
Merge pull request #95 from swolchok/absolute-dso-path
Browse files Browse the repository at this point in the history
generate.py: Make DSO path absolute
  • Loading branch information
mikekgfb authored Apr 9, 2024
2 parents 15730cc + f9d9544 commit b05e203
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def main(

if (checkpoint_path and (dso_path or pte_path)):
print("Warning: checkpoint path ignored because an exported DSO or PTE path specified")

if not tokenizer_path:
assert checkpoint_path, "either a tokenizer or a checkpoint path must be specified"
tokenizer_path = checkpoint_path.parent / "tokenizer.model"
Expand Down Expand Up @@ -359,7 +359,7 @@ def main(
# attributes will NOT be seen on by AOTI-compiled forward
# function, e.g. calling model.setup_cache will NOT touch
# AOTI compiled and maintained model buffers such as kv_cache.
model.forward = torch._export.aot_load(str(dso_path), device)
model.forward = torch._export.aot_load(str(dso_path.absolute()), device)
except:
raise RuntimeError(f"Failed to load AOTI compiled {dso_path}")
elif pte_path:
Expand Down Expand Up @@ -596,7 +596,7 @@ def cli():

if args.seed:
torch.manual_seed(args.seed)

main(
args.prompt,
args.interactive,
Expand Down

0 comments on commit b05e203

Please sign in to comment.