Skip to content

Commit

Permalink
Merge pull request #4 from caikit/chore/bump-caikit
Browse files Browse the repository at this point in the history
Bump Caikit to 0.18.1
  • Loading branch information
gkumbhat authored Sep 6, 2023
2 parents b99defd + 107ff5c commit 9c13964
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions demo/client/infer_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
channel = grpc.insecure_channel(f"localhost:{port}")
client_stub = inference_service.stub_class(channel)

## Create request object
## Create task request
hello_world_proto = HelloWorldInput(name="World").to_proto()
request = inference_service.messages.HelloWorldTaskRequest(text_input=hello_world_proto)

## Fetch predictions from server (infer)
## Fetch the task prediction from the model (infer)
response = client_stub.HelloWorldTaskPredict(
request, metadata=[("mm-model-id", MODEL_ID)]
)
Expand Down
4 changes: 2 additions & 2 deletions demo/client/train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
channel = grpc.insecure_channel(f"localhost:{port}")
client_stub = training_service.stub_class(channel)

## Create request
## Create train request
training_data = path.realpath(path.join("..", "train_data", "sample_data.csv"))
print("train data:", training_data)
request = training_service.messages.HelloWorldTaskHelloWorldModuleTrainRequest(
training_data={"file": {"filename": training_data}}, model_name="hello_world",
)

## Kick off training from server
## Kick off training from the server
response = client_stub.HelloWorldTaskHelloWorldModuleTrain(request)

print("RESPONSE:", response)
8 changes: 8 additions & 0 deletions demo/server/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ runtime:
# All models in this directory are loaded at boot time
local_models_dir: "../models"

grpc:
# Enable gRPC API
enabled: True

http:
# Enable REST API
enabled: True

# Training configuration
training:
# The directory to save trained models in
Expand Down
6 changes: 3 additions & 3 deletions demo/server/start_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Local
import caikit_template
import caikit
from caikit.runtime import grpc_server
from caikit.runtime.__main__ import main

# Load configuration for model(s) serving
CONFIG_PATH = path.realpath(
Expand All @@ -38,5 +38,5 @@

alog.configure(default_level="debug")

# Load the model(s) in a gRPC server
grpc_server.main()
# Start the Caikit runtime loading the model
main()
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
caikit==0.7.0
caikit[runtime-grpc, runtime-http]==0.18.1

0 comments on commit 9c13964

Please sign in to comment.