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
f0eee3fa
Commit
f0eee3fa
authored
Jun 23, 2023
by
Bruce MacDonald
Browse files
build server executable
parent
32c6d8e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
1 deletion
+31
-1
.gitignore
.gitignore
+4
-1
server/README.md
server/README.md
+6
-0
server/build.py
server/build.py
+20
-0
server/requirements.txt
server/requirements.txt
+1
-0
No files found.
.gitignore
View file @
f0eee3fa
.DS_Store
.DS_Store
.vscode
.vscode
\ No newline at end of file
*.spec
*/build
*/dist
\ No newline at end of file
server/README.md
View file @
f0eee3fa
...
@@ -18,6 +18,12 @@ pip install llama-cpp-python
...
@@ -18,6 +18,12 @@ pip install llama-cpp-python
pip
install
-r
requirements.txt
pip
install
-r
requirements.txt
```
```
## Building
```
bash
python3 build.py
```
## Running
## Running
Put your model in
`models/`
and run:
Put your model in
`models/`
and run:
...
...
server/build.py
0 → 100644
View file @
f0eee3fa
import
site
import
os
from
PyInstaller.__main__
import
run
as
pyi_run
# Get the directory of site-packages and llama_cpp
site_packages_dir
=
site
.
getsitepackages
()[
0
]
llama_cpp_dir
=
os
.
path
.
join
(
site_packages_dir
,
"llama_cpp"
)
# Prepare the arguments for PyInstaller
args
=
[
"server.py"
,
"--paths"
,
site_packages_dir
,
"--add-data"
,
f
"
{
llama_cpp_dir
}{
os
.
pathsep
}
llama_cpp"
,
"--onefile"
,
]
# Generate the .spec file and run PyInstaller
pyi_run
(
args
)
server/requirements.txt
View file @
f0eee3fa
Flask==2.3.2
Flask==2.3.2
flask_cors==3.0.10
flask_cors==3.0.10
llama-cpp-python==0.1.65
\ No newline at end of file
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