added a tmux inference dev setup script

This commit is contained in:
Yannic Kilcher
2023-01-27 15:40:21 +01:00
parent 83dc00b638
commit ae5d16f394
2 changed files with 21 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
# Creates a tmux window with splits for the individual services
tmux new-session -d -s "inference-dev-setup"
tmux send-keys "docker run --rm -it -p 6379:6379 redis" C-m
tmux split-window -h
tmux send-keys "docker run --rm -it -p 8001:80 -e MODEL_ID=distilgpt2 ykilcher/text-generation-inference" C-m
tmux split-window -h
tmux send-keys "cd server" C-m
tmux send-keys "uvicorn main:app --reload" C-m
tmux split-window -h
tmux send-keys "cd worker" C-m
tmux send-keys "python __main__.py" C-m
tmux split-window -h
tmux send-keys "cd text-client" C-m
tmux send-keys "sleep 5" C-m
tmux send-keys "python __main__.py" C-m
tmux attach-session -t "inference-dev-setup"
+2
View File
@@ -18,8 +18,10 @@ def main(
inference_server_url: str = "http://localhost:8001",
):
def on_open(ws: websocket.WebSocket):
logger.info("Connected to backend, sending config...")
worker_config = inference.WorkerConfig(model_name=model_name)
ws.send(worker_config.json())
logger.info("Config sent, waiting for work...")
def on_message(ws: websocket.WebSocket, message: str):
# TODO: what if this comes in, but one is already in progress?