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
OpenDAS
ollama
Commits
41fab3c3
"tests/vscode:/vscode.git/clone" did not exist on "49e336d25c43402f8a243dc4abcc0225e97873a9"
Commit
41fab3c3
authored
Jun 29, 2023
by
Michael Yang
Browse files
fix imports
parent
aa6448c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
ollama/engine.py
ollama/engine.py
+6
-5
No files found.
ollama/engine.py
View file @
41fab3c3
from
os
import
path
,
dup
,
dup2
,
devnull
import
os
import
sys
import
sys
from
os
import
path
from
contextlib
import
contextmanager
from
contextlib
import
contextmanager
from
llama_cpp
import
Llama
as
LLM
from
llama_cpp
import
Llama
as
LLM
...
@@ -9,12 +10,12 @@ import ollama.prompt
...
@@ -9,12 +10,12 @@ import ollama.prompt
@
contextmanager
@
contextmanager
def
suppress_stderr
():
def
suppress_stderr
():
stderr
=
dup
(
sys
.
stderr
.
fileno
())
stderr
=
os
.
dup
(
sys
.
stderr
.
fileno
())
with
open
(
devnull
,
"w"
)
as
devnull
:
with
open
(
os
.
devnull
,
"w"
)
as
devnull
:
dup2
(
devnull
.
fileno
(),
sys
.
stderr
.
fileno
())
os
.
dup2
(
devnull
.
fileno
(),
sys
.
stderr
.
fileno
())
yield
yield
dup2
(
stderr
,
sys
.
stderr
.
fileno
())
os
.
dup2
(
stderr
,
sys
.
stderr
.
fileno
())
def
generate
(
model
,
prompt
,
models_home
=
"."
,
llms
=
{},
*
args
,
**
kwargs
):
def
generate
(
model
,
prompt
,
models_home
=
"."
,
llms
=
{},
*
args
,
**
kwargs
):
...
...
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