Skip to content

Commit

Permalink
updating ray actor options
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroEsquivel committed Sep 10, 2024
1 parent 8a9a446 commit 38ad66e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app_ray_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

app = FastAPI()

@serve.deployment
@serve.deployment(num_replicas=1, ray_actor_options={"num_cpus": 1, "num_gpus": 1})
class InferenceDeployment:
def __init__(self):
self.spec = InferenceSpec()
Expand Down
18 changes: 14 additions & 4 deletions app_ray_serve_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,27 @@ logging_config:

applications:
- name: guardrails--toxic_language
route_prefix: /guardrails/toxic_language
route_prefix: /validator/guardrails/toxic_language
import_path: app_ray_serve:app
runtime_env: {
"pip": ["fastapi", "transformers", "torch", "torchvision", "detoxify"],
"working_dir": "https://github.com/guardrails-ai/toxic_language/archive/f208ad6aad6c4011a0e519de354e4a0f57b0c169.zip"
"working_dir": "https://github.com/guardrails-ai/toxic_language/archive/f208ad6aad6c4011a0e519de354e4a0f57b0c169.zip",
"env_vars": {
"env": "prod"
}
}
deployments:
- name: InferenceDeployment
num_replicas: 1
ray_actor_options:
num_cpus: 1.0
num_gpus: 1.0
user_config:
version: 14
version: 15
- name: Ingress
num_replicas: 1
ray_actor_options:
num_cpus: 2.0
num_gpus: 0.0
user_config:
version: 14
version: 15

0 comments on commit 38ad66e

Please sign in to comment.