Skip to content

Commit

Permalink
multiline_prompts -> multiline everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed May 10, 2024
1 parent 85ec235 commit 06b0c8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions litgpt/chat/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ def process_prompt(prompt, model, tokenizer, prompt_style, fabric, temperature,
fabric.print()


def interact(multiline_prompts, model, tokenizer, prompt_style, fabric, temperature, top_k, top_p, stop_tokens):
def interact(multiline, model, tokenizer, prompt_style, fabric, temperature, top_k, top_p, stop_tokens):
while True:
try:
if not multiline_prompts:
if not multiline:
prompt = input(">> Prompt: ")
else:
print(">> Prompt: (Type '!submit' on a new line to end input).")
Expand Down Expand Up @@ -194,7 +194,7 @@ def main(
for more details, see https://github.com/Lightning-AI/litgpt/blob/main/tutorials/quantize.md
precision: Indicates the Fabric precision setting to use.
compile: Whether to use compilation to speed up token generation. Will increase startup time.
multiline_prompts: Whether to support multiline input prompts.
multiline: Whether to support multiline input prompts.
"""
precision = precision or get_default_supported_precision(training=False)

Expand Down Expand Up @@ -240,7 +240,7 @@ def main(
)
stop_tokens = prompt_style.stop_tokens(tokenizer)

if multiline_prompts:
if multiline:
exit_instruction = "To exit, enter '!quit' or '!exit' on an empty prompt and press 'Enter'."
else:
exit_instruction = "To exit, press 'Enter' on an empty prompt."
Expand All @@ -249,7 +249,7 @@ def main(
L.seed_everything(1234)

interact(
multiline_prompts=multiline_prompts,
multiline=multiline,
model=model,
tokenizer=tokenizer,
prompt_style=prompt_style,
Expand Down
2 changes: 1 addition & 1 deletion tutorials/0_to_litgpt.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Time for inference: 1.26 sec total, 27.81 tokens/sec, 35 tokens
 

> [!TIP]
> Use `--multiline_prompts true` to support prompts that require multiple input lines.
> Use `--multiline true` to support prompts that require multiple input lines.
<br>

Expand Down
2 changes: 1 addition & 1 deletion tutorials/inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This script can work with any checkpoint. For the best chat-like experience, we
fine-tuned for chatting such as `stabilityai/stablelm-tuned-alpha-3b` or `togethercomputer/RedPajama-INCITE-Chat-3B-v1`.

> [!TIP]
> Use `--multiline_prompts` to work with inputs that span multiple lines.
> Use `--multiline true` to work with inputs that span multiple lines.

## Run a large model on one smaller device
Expand Down

0 comments on commit 06b0c8c

Please sign in to comment.