Skip to content

Commit

Permalink
Merge GenerateArgs changes
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryComer committed Apr 17, 2024
1 parent 6466e23 commit c1660a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ class GeneratorArgs:
def from_args(cls, args): # -> GeneratorArgs:
return cls(
prompt=args.prompt,
<<<<<<< HEAD
encoded_prompt=None,
chat_mode=args.chat,
=======
chat_mode=hasattr(args, "subcommand") and args.subcommand == "chat",
>>>>>>> 0dc48b0 (Merge GenerateArgs changes)
gui_mode=args.gui,
num_samples=args.num_samples,
max_new_tokens=args.max_new_tokens,
Expand Down Expand Up @@ -507,8 +511,6 @@ def callback(x):


def main(args):
is_chat = args.subcommand == "chat"

# If a named model was provided and not downloaded, download it.
if args.model and not is_model_downloaded(args.model, args.model_directory):
download_and_convert(args.model, args.model_directory, args.hf_token)
Expand Down

0 comments on commit c1660a3

Please sign in to comment.