Skip to content

Commit

Permalink
Merge pull request #108 from opendatahub-io/fix-convert-script
Browse files Browse the repository at this point in the history
utils: prevent convert.py from erroring out
  • Loading branch information
openshift-ci[bot] authored Oct 18, 2023
2 parents 46d41ab + a0203d2 commit 747af55
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions utils/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
import caikit_nlp
import argparse

parser = argparse.ArgumentParser(prog="convert.py")
parser.add_argument("--model-path", help="Path of the base HuggingFace model", )
parser.add_argument("--model-save-path", help="Path to save the Caikit format model to")

args = parser.parse_args()
def main():
parser = argparse.ArgumentParser(prog="convert.py")
parser.add_argument("--model-path", help="Path of the base HuggingFace model", )
parser.add_argument("--model-save-path", help="Path to save the Caikit format model to")

model = caikit_nlp.text_generation.TextGeneration.bootstrap(args.model_path)
args = parser.parse_args()

model.save(model_path=args.model_save_path)
model = caikit_nlp.text_generation.TextGeneration.bootstrap(args.model_path)

model.save(model_path=args.model_save_path)


if __name__ == "__main__":
main()

0 comments on commit 747af55

Please sign in to comment.