Browse Source

reorganize directories

go-opts
Jeffrey Morgan 3 years ago
parent
commit
b361fa72ec
  1. 5
      .gitignore
  2. 56
      README.md
  3. 3
      build.py
  4. 0
      desktop/.eslintrc.json
  5. 0
      desktop/.gitignore
  6. 0
      desktop/.prettierrc.json
  7. 0
      desktop/forge.config.ts
  8. 0
      desktop/images/icon.icns
  9. 0
      desktop/package-lock.json
  10. 0
      desktop/package.json
  11. 0
      desktop/postcss.config.js
  12. 0
      desktop/src/app.css
  13. 0
      desktop/src/app.tsx
  14. 0
      desktop/src/index.html
  15. 0
      desktop/src/index.ts
  16. 0
      desktop/src/preload.ts
  17. 0
      desktop/src/renderer.tsx
  18. 0
      desktop/tailwind.config.js
  19. 0
      desktop/tsconfig.json
  20. 0
      desktop/webpack.main.config.ts
  21. 0
      desktop/webpack.plugins.ts
  22. 0
      desktop/webpack.renderer.config.ts
  23. 0
      desktop/webpack.rules.ts
  24. 0
      proto.py
  25. 0
      requirements.txt
  26. 5
      server/.gitignore
  27. 39
      server/README.md

5
.gitignore

@ -1,2 +1,7 @@
.DS_Store
.vscode
.env
.venv
*.spec
build
dist

56
README.md

@ -1,8 +1,58 @@
# Prototype
# proto
## Setup
🙊
## Running
Install dependencies:
```
brew install npm
pip install -r requirements.txt
```
Put your model in `models/` and run:
```
python proto.py
```
To run the app:
```
cd desktop
npm install
npm start
```
## Building
If using Apple silicon, you need a Python version that supports arm64:
```bash
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh
```
Get the dependencies:
```bash
pip install -r requirements.txt
```
```bash
python3 build.py
```
Then to build the app:
```
cd desktop
npm run package
```
## API
### `POST /generate`
model: `string` - The name of the model to use in the `models` folder.
prompt: `string` - The prompt to use.

3
server/build.py → build.py

@ -7,7 +7,7 @@ site_packages_dir = site.getsitepackages()[0]
llama_cpp_dir = os.path.join(site_packages_dir, "llama_cpp")
args = [
"server.py",
"proto.py",
"--paths",
site_packages_dir,
"--add-data",
@ -17,4 +17,3 @@ args = [
# generate the .spec file and run PyInstaller
pyi_run(args)

0
client/.eslintrc.json → desktop/.eslintrc.json

0
client/.gitignore → desktop/.gitignore

0
.prettierrc.json → desktop/.prettierrc.json

0
client/forge.config.ts → desktop/forge.config.ts

0
client/images/icon.icns → desktop/images/icon.icns

0
client/package-lock.json → desktop/package-lock.json

0
client/package.json → desktop/package.json

0
client/postcss.config.js → desktop/postcss.config.js

0
client/src/app.css → desktop/src/app.css

0
client/src/app.tsx → desktop/src/app.tsx

0
client/src/index.html → desktop/src/index.html

0
client/src/index.ts → desktop/src/index.ts

0
client/src/preload.ts → desktop/src/preload.ts

0
client/src/renderer.tsx → desktop/src/renderer.tsx

0
client/tailwind.config.js → desktop/tailwind.config.js

0
client/tsconfig.json → desktop/tsconfig.json

0
client/webpack.main.config.ts → desktop/webpack.main.config.ts

0
client/webpack.plugins.ts → desktop/webpack.plugins.ts

0
client/webpack.renderer.config.ts → desktop/webpack.renderer.config.ts

0
client/webpack.rules.ts → desktop/webpack.rules.ts

0
server/server.py → proto.py

0
server/requirements.txt → requirements.txt

5
server/.gitignore

@ -1,5 +0,0 @@
.env
.venv
*.spec
build
dist

39
server/README.md

@ -1,39 +0,0 @@
# Server
🙊
## Installation
If using Apple silicon, you need a Python version that supports arm64:
```bash
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh
```
Get the dependencies:
```bash
pip install -r requirements.txt
```
## Building
```bash
python3 build.py
```
## Running
Put your model in `models/` and run:
```bash
python server.py
```
## API
### `POST /generate`
model: `string` - The name of the model to use in the `models` folder.
prompt: `string` - The prompt to use.
Loading…
Cancel
Save