mirror of
https://github.com/Hopiu/llm.git
synced 2026-04-22 22:14:46 +00:00
Nicer error message for unknown models with -c mode, closes #92
This commit is contained in:
parent
9a226a8b43
commit
7bef414de7
2 changed files with 6 additions and 2 deletions
|
|
@ -79,7 +79,7 @@ def get_model(name):
|
|||
try:
|
||||
return aliases[name]
|
||||
except KeyError:
|
||||
raise UnknownModelError(name)
|
||||
raise UnknownModelError("Unknown model: " + name)
|
||||
|
||||
|
||||
def get_key(key_arg, default_key, env_var=None):
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from llm import (
|
|||
Conversation,
|
||||
Response,
|
||||
Template,
|
||||
UnknownModelError,
|
||||
get_key,
|
||||
get_plugins,
|
||||
get_model,
|
||||
|
|
@ -184,7 +185,10 @@ def prompt(
|
|||
conversation = None
|
||||
if conversation_id or _continue:
|
||||
# Load the conversation - loads most recent if no ID provided
|
||||
conversation = load_conversation(conversation_id)
|
||||
try:
|
||||
conversation = load_conversation(conversation_id)
|
||||
except UnknownModelError as ex:
|
||||
raise click.ClickException(str(ex))
|
||||
|
||||
# Figure out which model we are using
|
||||
if model_id is None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue