diff --git a/src/routes/components/code-blocks.svelte b/src/routes/components/code-blocks.svelte index 5117291f2af82..5d2fdebb8b0c6 100644 --- a/src/routes/components/code-blocks.svelte +++ b/src/routes/components/code-blocks.svelte @@ -17,7 +17,7 @@ let javaCode = 'import ai.onnxruntime.*;\n// Load the model and create InferenceSession\nString modelPath = "path/to/your/onnx/model";\nOrtEnvironment env = OrtEnvironment.getEnvironment();\nOrtSession session = env.createSession(modelPath);\n// Load and preprocess the input image to inputTensor\n...\n// Run inference\nOrtSession.Result outputs = session.run(inputTensor);\nSystem.out.println(outputs.get(0).getTensor().getFloatBuffer().get(0));\n\n'; let cppCode = - '#include "onnxruntime_cxx_api.h"\n// Load the model and create InferenceSession\nOrt::Env env;\nstd::string model_path = "path/to/your/onnx/model";\nOrt::Session session(env, model_path, Ort::SessionOptions{ nullptr });\n// Load and preprocess the input image to inputTensor\n...\n// Run inference\nstd::vector outputTensors =\nsession.Run(Ort::RunOptions{nullptr}, inputNames.data(), &inputTensor, \n  inputNames.size(), outputNames.data(), outputNames.size());\nconst float* outputDataPtr = outputTensors[0].GetTensorMutableData();\nstd::cout << outputDataPtr[0] << std::endl;'; + '#include "onnxruntime_cxx_api.h"\n// Load the model and create InferenceSession\nOrt::Env env;\nstd::string model_path = "path/to/your/onnx/model";\nOrt::Session session(env, model_path, Ort::SessionOptions{ nullptr });\n// Load and preprocess the input image to inputTensor\n...\n// Run inference\nstd::vector outputTensors =\nsession.Run(Ort::RunOptions{nullptr}, inputNames.data(), &inputTensor, \n inputNames.size(), outputNames.data(), outputNames.size());\nconst float* outputDataPtr = outputTensors[0].GetTensorMutableData();\nstd::cout << outputDataPtr[0] << std::endl;'; // a svelte function to conditionally render different "Highlight" components based on what tab was clicked let activeTab = 'Python'; // set the initial active tab to Python