From e0162d9ed495721a968ef80a985be617c40032e3 Mon Sep 17 00:00:00 2001 From: Purusharth Saxena Date: Tue, 14 May 2024 18:12:27 +0200 Subject: [PATCH 1/2] update models/readme.md Added an addition function for evaluate in Julia minimal server example to make it more consistent with python and C++ examples (earlier, an anonymous in-line function was used) --- models/README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/models/README.md b/models/README.md index abfd24e..dde8206 100644 --- a/models/README.md +++ b/models/README.md @@ -150,11 +150,15 @@ Optionally, configuration options may be passed to the model by the client: `con For more flexibility, the model's input and output dimensions may optionally depend on `config`. ``` -testmodel = UMBridge.Model(name="forward", inputSizes=[1], outputSizes=[1]) - -UMBridge.define_evaluate(testmodel, (input, config) -> (2*input)) +# Define the model behavior +function evaluate(input::Vector{Any}, config::Dict{String, Any}) + output = 2 * input + return [output] +end -UMBridge.serve_models([testmodel], 4242) +testmodel = UMBridge.Model(name="forward", inputSizes=[1], outputSizes=[1]) +UMBridge.define_evaluate(testmodel, evaluate) +UMBridge.serve_models([testmodel], 4232) ``` ## MUQ server From c578ca67ddccce74a81402e1eca8412f55be65d3 Mon Sep 17 00:00:00 2001 From: Purusharth Saxena Date: Tue, 14 May 2024 19:48:06 +0200 Subject: [PATCH 2/2] Removed redundant comment --- models/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/models/README.md b/models/README.md index dde8206..bb2d3d8 100644 --- a/models/README.md +++ b/models/README.md @@ -150,7 +150,6 @@ Optionally, configuration options may be passed to the model by the client: `con For more flexibility, the model's input and output dimensions may optionally depend on `config`. ``` -# Define the model behavior function evaluate(input::Vector{Any}, config::Dict{String, Any}) output = 2 * input return [output]