Skip to content

Commit

Permalink
fix bug merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cotran2 committed Oct 1, 2024
1 parent 68d37e2 commit 5eb0abd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
24 changes: 12 additions & 12 deletions demos/function_calling/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ x-variables: &common-vars

services:

config_generator:
build:
context: ../../
dockerfile: config_generator/Dockerfile
volumes:
- ../../arch/envoy.template.yaml:/usr/src/app/envoy.template.yaml
- ./arch_config.yaml:/usr/src/app/arch_config.yaml
- ./generated:/usr/src/app/out
# config_generator:
# build:
# context: ../../
# dockerfile: config_generator/Dockerfile
# volumes:
# - ../../arch/envoy.template.yaml:/usr/src/app/envoy.template.yaml
# - ./arch_config.yaml:/usr/src/app/arch_config.yaml
# - ./generated:/usr/src/app/out

arch:
build:
Expand All @@ -25,9 +25,9 @@ services:
- /etc/ssl/cert.pem:/etc/ssl/cert.pem
- ./arch_log:/var/log/
depends_on:
config_generator:
condition: service_completed_successfully
model_server:
# config_generator:
# condition: service_completed_successfully
archgw_model_server:
condition: service_healthy
environment:
- LOG_LEVEL=debug
Expand All @@ -48,7 +48,7 @@ services:
<<: *common-vars
environment:
- OLLAMA_ENDPOINT=${OLLAMA_ENDPOINT:-host.docker.internal}
- FC_URL=${FC_URL:}
- FC_URL=${FC_URL:-empty}
- OLLAMA_MODEL=Arch-Function-Calling-3B-Q4_K_M
- MODE=${MODE:-cloud}
# uncomment following line to use ollama endpoint that is hosted by docker
Expand Down
2 changes: 1 addition & 1 deletion model_server/app/arch_fc/arch_fc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
if mode == "cloud":
client = OpenAI(
base_url=fc_url,
api_key=arch_api_key,
api_key="EMPTY",
)
models = client.models.list()
model = models.data[0].id
Expand Down
4 changes: 3 additions & 1 deletion model_server/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

with open("guard_model_config.yaml") as f:
guard_model_config = yaml.safe_load(f)
with open('/root/arch_config.yaml') as f:
config = yaml.safe_load(f)
mode = os.getenv("MODE", "cloud")
logger.info(f"Serving model mode: {mode}")
if mode not in ['cloud', 'local-gpu', 'local-cpu']:
Expand All @@ -44,7 +46,7 @@
)
toxic_model = None

guard_handler = GuardHandler(toxic_model=None, jailbreak_model=jailbreak_model)
guard_handler = GuardHandler(toxic_model=toxic_model, jailbreak_model=jailbreak_model)

app = FastAPI()

Expand Down
File renamed without changes.

0 comments on commit 5eb0abd

Please sign in to comment.