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
53579c51
Commit
53579c51
authored
Jun 27, 2023
by
Bruce MacDonald
Browse files
Change default port
parent
a0527284
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
ollama.py
ollama.py
+1
-7
No files found.
ollama.py
View file @
53579c51
...
@@ -2,7 +2,6 @@ import json
...
@@ -2,7 +2,6 @@ import json
import
os
import
os
import
threading
import
threading
import
click
import
click
from
transformers
import
AutoModel
from
tqdm
import
tqdm
from
tqdm
import
tqdm
from
pathlib
import
Path
from
pathlib
import
Path
from
llama_cpp
import
Llama
from
llama_cpp
import
Llama
...
@@ -160,7 +159,7 @@ def cli(ctx):
...
@@ -160,7 +159,7 @@ def cli(ctx):
@
cli
.
command
()
@
cli
.
command
()
@
click
.
option
(
"--port"
,
default
=
5000
,
help
=
"Port to run the server on"
)
@
click
.
option
(
"--port"
,
default
=
7734
,
help
=
"Port to run the server on"
)
@
click
.
option
(
"--debug"
,
default
=
False
,
help
=
"Enable debug mode"
)
@
click
.
option
(
"--debug"
,
default
=
False
,
help
=
"Enable debug mode"
)
def
serve
(
port
,
debug
):
def
serve
(
port
,
debug
):
print
(
"Serving on http://localhost:{port}"
)
print
(
"Serving on http://localhost:{port}"
)
...
@@ -196,11 +195,6 @@ def generate_cli(model, prompt):
...
@@ -196,11 +195,6 @@ def generate_cli(model, prompt):
print
(
f
"
\r
{
output
}
"
,
end
=
""
,
flush
=
True
)
print
(
f
"
\r
{
output
}
"
,
end
=
""
,
flush
=
True
)
def
download_model
(
model_name
):
dir
=
models_directory
()
AutoModel
.
from_pretrained
(
model_name
,
cache_dir
=
dir
)
@
cli
.
command
(
name
=
"models"
)
@
cli
.
command
(
name
=
"models"
)
def
models_cli
():
def
models_cli
():
print
(
models
())
print
(
models
())
...
...
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