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
9164981d
Commit
9164981d
authored
Jul 03, 2023
by
Jeffrey Morgan
Browse files
move prompt templates out of python bindings
parent
6093a88c
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
11 additions
and
11 deletions
+11
-11
cmd/cmd.go
cmd/cmd.go
+4
-4
llama/CMakeLists.txt
llama/CMakeLists.txt
+1
-0
server/routes.go
server/routes.go
+6
-7
templates/alpaca.prompt
templates/alpaca.prompt
+0
-0
templates/falcon.prompt
templates/falcon.prompt
+0
-0
templates/gpt4.prompt
templates/gpt4.prompt
+0
-0
templates/hermes.prompt
templates/hermes.prompt
+0
-0
templates/mpt.prompt
templates/mpt.prompt
+0
-0
templates/oasst.prompt
templates/oasst.prompt
+0
-0
templates/orca.prompt
templates/orca.prompt
+0
-0
templates/qlora.prompt
templates/qlora.prompt
+0
-0
templates/tulu.prompt
templates/tulu.prompt
+0
-0
templates/ultralm.prompt
templates/ultralm.prompt
+0
-0
templates/vicuna.prompt
templates/vicuna.prompt
+0
-0
templates/wizardcoder.prompt
templates/wizardcoder.prompt
+0
-0
templates/wizardlm.prompt
templates/wizardlm.prompt
+0
-0
No files found.
cmd/cmd.go
View file @
9164981d
...
@@ -59,7 +59,7 @@ func NewCLI() *cobra.Command {
...
@@ -59,7 +59,7 @@ func NewCLI() *cobra.Command {
rootCmd
:=
&
cobra
.
Command
{
rootCmd
:=
&
cobra
.
Command
{
Use
:
"ollama"
,
Use
:
"ollama"
,
Short
:
"
Run any l
arge language model
on any machi
ne
.
"
,
Short
:
"
L
arge language model
run
ne
r
"
,
CompletionOptions
:
cobra
.
CompletionOptions
{
CompletionOptions
:
cobra
.
CompletionOptions
{
DisableDefaultCmd
:
true
,
DisableDefaultCmd
:
true
,
},
},
...
@@ -88,14 +88,13 @@ func NewCLI() *cobra.Command {
...
@@ -88,14 +88,13 @@ func NewCLI() *cobra.Command {
},
},
}
}
/*
runCmd
:=
&
cobra
.
Command
{
runCmd
:=
&
cobra
.
Command
{
Use
:
"run"
,
Use
:
"run"
,
Short
:
"Run a model and submit prompts."
,
Short
:
"Run a model and submit prompts."
,
RunE: func(cmd *cobra.Command. args []string) error {
RunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
return
nil
},
},
}
}
*/
serveCmd
:=
&
cobra
.
Command
{
serveCmd
:=
&
cobra
.
Command
{
Use
:
"serve"
,
Use
:
"serve"
,
...
@@ -132,6 +131,7 @@ func NewCLI() *cobra.Command {
...
@@ -132,6 +131,7 @@ func NewCLI() *cobra.Command {
rootCmd
.
AddCommand
(
rootCmd
.
AddCommand
(
modelsCmd
,
modelsCmd
,
serveCmd
,
serveCmd
,
runCmd
,
)
)
return
rootCmd
return
rootCmd
...
...
llama/CMakeLists.txt
View file @
9164981d
...
@@ -23,5 +23,6 @@ target_include_directories(binding PRIVATE ${llama_cpp_SOURCE_DIR})
...
@@ -23,5 +23,6 @@ target_include_directories(binding PRIVATE ${llama_cpp_SOURCE_DIR})
target_include_directories
(
binding PRIVATE
${
llama_cpp_SOURCE_DIR
}
/examples
)
target_include_directories
(
binding PRIVATE
${
llama_cpp_SOURCE_DIR
}
/examples
)
target_link_libraries
(
binding llama ggml_static
)
target_link_libraries
(
binding llama ggml_static
)
configure_file
(
${
llama_cpp_SOURCE_DIR
}
/ggml-metal.metal
${
CMAKE_CURRENT_BINARY_DIR
}
/ggml-metal.metal COPYONLY
)
configure_file
(
${
llama_cpp_BINARY_DIR
}
/libllama.a
${
CMAKE_CURRENT_BINARY_DIR
}
/libllama.a COPYONLY
)
configure_file
(
${
llama_cpp_BINARY_DIR
}
/libllama.a
${
CMAKE_CURRENT_BINARY_DIR
}
/libllama.a COPYONLY
)
configure_file
(
${
llama_cpp_BINARY_DIR
}
/libggml_static.a
${
CMAKE_CURRENT_BINARY_DIR
}
/libggml_static.a COPYONLY
)
configure_file
(
${
llama_cpp_BINARY_DIR
}
/libggml_static.a
${
CMAKE_CURRENT_BINARY_DIR
}
/libggml_static.a COPYONLY
)
server/routes.go
View file @
9164981d
...
@@ -36,6 +36,8 @@ func Serve(ln net.Listener) error {
...
@@ -36,6 +36,8 @@ func Serve(ln net.Listener) error {
})
})
r
.
POST
(
"/api/generate"
,
func
(
c
*
gin
.
Context
)
{
r
.
POST
(
"/api/generate"
,
func
(
c
*
gin
.
Context
)
{
// TODO: set prompt from template
var
req
api
.
GenerateRequest
var
req
api
.
GenerateRequest
if
err
:=
c
.
ShouldBindJSON
(
&
req
);
err
!=
nil
{
if
err
:=
c
.
ShouldBindJSON
(
&
req
);
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"message"
:
err
.
Error
()})
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"message"
:
err
.
Error
()})
...
@@ -64,13 +66,10 @@ func Serve(ln net.Listener) error {
...
@@ -64,13 +66,10 @@ func Serve(ln net.Listener) error {
return
true
return
true
})
})
/*
// embeds, err := l.Embeddings(text)
embeds, err := l.Embeddings(text)
// if err != nil {
if err != nil {
// fmt.Printf("Embeddings: error %s \n", err.Error())
fmt.Printf("Embeddings: error %s \n", err.Error())
// }
}
*/
})
})
log
.
Printf
(
"Listening on %s"
,
ln
.
Addr
())
log
.
Printf
(
"Listening on %s"
,
ln
.
Addr
())
...
...
python/ollama/
templates/alpaca.prompt
→
templates/alpaca.prompt
View file @
9164981d
File moved
python/ollama/
templates/falcon.prompt
→
templates/falcon.prompt
View file @
9164981d
File moved
python/ollama/
templates/gpt4.prompt
→
templates/gpt4.prompt
View file @
9164981d
File moved
python/ollama/
templates/hermes.prompt
→
templates/hermes.prompt
View file @
9164981d
File moved
python/ollama/
templates/mpt.prompt
→
templates/mpt.prompt
View file @
9164981d
File moved
python/ollama/
templates/oasst.prompt
→
templates/oasst.prompt
View file @
9164981d
File moved
python/ollama/
templates/orca.prompt
→
templates/orca.prompt
View file @
9164981d
File moved
python/ollama/
templates/qlora.prompt
→
templates/qlora.prompt
View file @
9164981d
File moved
python/ollama/
templates/tulu.prompt
→
templates/tulu.prompt
View file @
9164981d
File moved
python/ollama/
templates/ultralm.prompt
→
templates/ultralm.prompt
View file @
9164981d
File moved
python/ollama/
templates/vicuna.prompt
→
templates/vicuna.prompt
View file @
9164981d
File moved
python/ollama/
templates/wizardcoder.prompt
→
templates/wizardcoder.prompt
View file @
9164981d
File moved
python/ollama/
templates/wizardlm.prompt
→
templates/wizardlm.prompt
View file @
9164981d
File moved
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