Skip to content

Commit

Permalink
Merge pull request #5 from classtranscribe/demo-with-workers
Browse files Browse the repository at this point in the history
Preliminary demo with worker(s)
  • Loading branch information
angrave authored Feb 24, 2025
2 parents 632adb9 + 384d67a commit bd0e6da
Show file tree
Hide file tree
Showing 33 changed files with 3,010 additions and 213 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ server/models/TabRec/

server/inputs/
server/outputs/
server/uploads/*.png
server/*.db*

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -137,7 +139,6 @@ celerybeat.pid
*.sage.py

# Environments
.env
.venv
env/
venv/
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ docker run -i -p 8080:80 -t latextranscribe
- CPU:
```sh
docker build -t latextranscribe -f server/Dockerfile.cpu ./server/
docker run --name latextranscribe --rm -i -p 8081:80 -t latextranscribe
docker run --name latextranscribe --rm -i -p 8000:8000 -t latextranscribe
```
- GPU (CUDA >= 12.4):
```sh
docker build -t latextranscribe -f server/Dockerfile.gpu ./server/
docker run --name latextranscribe --rm --gpus '"device=0"' -i -p 8081:80 -t latextranscribe
docker run --name latextranscribe --rm --gpus '"device=0"' -i -p 8000:8000 -t latextranscribe
```
- Go to `http://localhost:8081` and you should now see `The server is running!`
- Go to `http://localhost:8000` and you should now see `The server is running!`
### Frontend
- Build and run the frontend Docker image:
```sh
Expand Down Expand Up @@ -75,7 +75,11 @@ docker run -i -p 8080:80 -t latextranscribe
```
- Run the server (`uv run` runs `python` in the virtual environment):
```sh
uv run uvicorn app:app --host 0.0.0.0 --port 8081
uv run uvicorn app:app --host 0.0.0.0 --port 8000 --reload --log-level debug
```
- In another terminal, run the pipeline worker:
```sh
uv run huey_consumer.py src.pipeline_task.huey
```
- TESTING – Or run the ML pipeline:
```sh
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ services:
dockerfile: Dockerfile.cpu
image: latextranscribe
ports:
- 8081:80
command: ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80", "--reload"]
- 8000:8000
command: ["supervisord"] # ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--log-level", "debug"]
develop:
watch:
- action: sync
Expand Down
1 change: 1 addition & 0 deletions frontend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_ROOT_API="https://classtranscribe.illinois.edu/latextranscribe"
2 changes: 1 addition & 1 deletion frontend/.env.development
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_ROOT_API="http://localhost:8081"
VITE_ROOT_API="http://localhost:8000"
122 changes: 24 additions & 98 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.7.9",
"katex": "^0.16.21",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
Expand All @@ -18,4 +18,4 @@
"vite": "^6.0.11",
"vite-plugin-vue-devtools": "^7.7.0"
}
}
}
Loading

0 comments on commit bd0e6da

Please sign in to comment.