Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
orangecat
ollama
Commits
55ab5e60
"vscode:/vscode.git/clone" did not exist on "6a3d1f2dfb4e5dd37ca12dbdf459a393955bafd3"
Commit
55ab5e60
authored
Jun 29, 2023
by
Bruce MacDonald
Browse files
return an error when the model cant be loaded
parent
e4bdacb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
ollama/engine.py
ollama/engine.py
+8
-5
No files found.
ollama/engine.py
View file @
55ab5e60
...
...
@@ -45,11 +45,14 @@ def load(model, models_home=".", llms={}):
# try loading this as a path to a model, rather than a model name
model_path
=
os
.
path
.
abspath
(
model
)
# suppress LLM's output
with
suppress_stderr
():
llm
=
LLM
(
model_path
,
verbose
=
False
)
llms
.
update
({
model
:
llm
})
try
:
# suppress LLM's output
with
suppress_stderr
():
llm
=
LLM
(
model_path
,
verbose
=
False
)
llms
.
update
({
model
:
llm
})
except
Exception
as
e
:
# e is sent to devnull, so create a generic exception
raise
Exception
(
f
"Failed to load model:
{
model
}
"
)
return
llm
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment