Skip to content

Commit

Permalink
Update code-blocks.svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
prasanthpul authored Oct 27, 2023
1 parent 14eac0f commit 500b3a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/components/code-blocks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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&nbsp;&nbsp;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
Expand Down

0 comments on commit 500b3a4

Please sign in to comment.