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
beb49eef
"vscode:/vscode.git/clone" did not exist on "b373034e31c0d0796363e389f4b6f02acfd77a71"
Commit
beb49eef
authored
Jun 07, 2024
by
Michael Yang
Browse files
create bert models from cli
parent
5a28b9cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
cmd/cmd.go
cmd/cmd.go
+13
-0
No files found.
cmd/cmd.go
View file @
beb49eef
...
@@ -223,6 +223,14 @@ func tempZipFiles(path string) (string, error) {
...
@@ -223,6 +223,14 @@ func tempZipFiles(path string) (string, error) {
}
}
files
=
append
(
files
,
js
...
)
files
=
append
(
files
,
js
...
)
// bert models require a nested config.json
// TODO(mxyng): merge this with the glob above
js
,
err
=
glob
(
filepath
.
Join
(
path
,
"**/*.json"
),
"text/plain"
)
if
err
!=
nil
{
return
""
,
err
}
files
=
append
(
files
,
js
...
)
if
tks
,
_
:=
glob
(
filepath
.
Join
(
path
,
"tokenizer.model"
),
"application/octet-stream"
);
len
(
tks
)
>
0
{
if
tks
,
_
:=
glob
(
filepath
.
Join
(
path
,
"tokenizer.model"
),
"application/octet-stream"
);
len
(
tks
)
>
0
{
// add tokenizer.model if it exists, tokenizer.json is automatically picked up by the previous glob
// add tokenizer.model if it exists, tokenizer.json is automatically picked up by the previous glob
// tokenizer.model might be a unresolved git lfs reference; error if it is
// tokenizer.model might be a unresolved git lfs reference; error if it is
...
@@ -252,6 +260,11 @@ func tempZipFiles(path string) (string, error) {
...
@@ -252,6 +260,11 @@ func tempZipFiles(path string) (string, error) {
return
""
,
err
return
""
,
err
}
}
zfi
.
Name
,
err
=
filepath
.
Rel
(
path
,
file
)
if
err
!=
nil
{
return
""
,
err
}
zf
,
err
:=
zipfile
.
CreateHeader
(
zfi
)
zf
,
err
:=
zipfile
.
CreateHeader
(
zfi
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
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