A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 02:15 UTC
Fix: Add missing EOFError handling in CLI complete command (#20896)
Signed-off-by: reidliu41 <reid201711@gmail.com>
Reid committed
Jul 14, 2025 at 15:09 UTC
2c7fa47161ba513817a80e165c86a66760c06ebb
1 file changed
+6
-3
vllm/entrypoints/cli/openai.py
+6
-3
@@ -55,7 +55,7 @@ def chat(system_prompt: str | None, model_name: str, client: OpenAI) -> None:
55
try:
56
input_message = input("> ")
57
except EOFError:
58
- return
58
+ break
59
conversation.append({"role": "user", "content": input_message})
60
61
chat_completion = client.chat.completions.create(model=model_name,
@@ -118,7 +118,7 @@ class ChatCommand(CLISubcommand):
118
try:
119
input_message = input("> ")
120
except EOFError:
121
- return
121
+ break
122
conversation.append({"role": "user", "content": input_message})
123
124
chat_completion = client.chat.completions.create(
@@ -170,7 +170,10 @@ class CompleteCommand(CLISubcommand):
170
171
print("Please enter prompt to complete:")
172
while True:
173
- input_prompt = input("> ")
173
+ try:
174
+ input_prompt = input("> ")
175
+ except EOFError:
176
+ break
177
completion = client.completions.create(model=model_name,
178
prompt=input_prompt)
179
output = completion.choices[0].text