Skip to content

Commit

Permalink
Spin Model Server in chatbot recipe
Browse files Browse the repository at this point in the history
Signed-off-by: Liora Milbaum <[email protected]>
  • Loading branch information
lmilbaum committed Mar 31, 2024
1 parent 36c6389 commit 8cd80ba
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/chatbot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ on:
pull_request:
branches:
- main
paths:
- ./recipes/natural_language_processing/chatbot/**
- .github/workflows/chatbot.yaml
push:
branches:
- main
paths:
- ./recipes/natural_language_processing/chatbot/**
- .github/workflows/chatbot.yaml

env:
REGISTRY: ghcr.io
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/model_servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ on:
pull_request:
branches:
- main
paths:
- ./model_servers/llamacpp_python/**
- .github/workflows/model_servers.yaml
push:
branches:
- main
paths:
- ./model_servers/llamacpp_python/**
- .github/workflows/model_servers.yaml

env:
REGISTRY: ghcr.io
Expand Down
22 changes: 22 additions & 0 deletions recipes/natural_language_processing/chatbot/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
import pytest_container
import os

MS = pytest_container.Container(
url=f"containers-storage:{os.environ['REGISTRY']}/model_servers",
volume_mounts=[
pytest_container.container.BindMount(
container_path="/locallm/models",
host_path="./",
flags=["ro"]
)
],
extra_environment_variables={
"MODEL_PATH": "models/mistral-7b-instruct-v0.1.Q4_K_M.gguf",
"HOST": "0.0.0.0",
"PORT": "8001"
},
forwarded_ports=[
pytest_container.PortForwarding(
container_port=8001,
host_port=8001
)
],
extra_launch_args=["--net=host"]
)

CB = pytest_container.Container(
url=f"containers-storage:{os.environ['REGISTRY']}/{os.environ['IMAGE_NAME']}",
Expand Down

0 comments on commit 8cd80ba

Please sign in to comment.