Skip to content

Commit

Permalink
Fix datatype - onnx only has int64_t attributes.
Browse files Browse the repository at this point in the history
Update test model to validate timeout is read correctly.
  • Loading branch information
skottmckay committed Aug 22, 2023
1 parent 5a889b4 commit d778ace
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion operators/azure/cloud_base_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include <sstream>

#include "narrow.h"

namespace ort_extensions {
CloudBaseKernel::CloudBaseKernel(const OrtApi& api, const OrtKernelInfo& info)
: BaseKernel(api, info),
Expand All @@ -22,7 +24,7 @@ CloudBaseKernel::CloudBaseKernel(const OrtApi& api, const OrtKernelInfo& info)

model_name_ = TryToGetAttributeWithDefault<std::string>(kModelName, "");
model_ver_ = TryToGetAttributeWithDefault<std::string>(kModelVer, "0");
timeout_seconds_ = TryToGetAttributeWithDefault<int>(kTimeout, kDefaultTimeoutSeconds);
timeout_seconds_ = narrow<int>(TryToGetAttributeWithDefault<int64_t>(kTimeout, kDefaultTimeoutSeconds));
verbose_ = TryToGetAttributeWithDefault<std::string>(kVerbose, "0") != "0";

OrtStatusPtr status{};
Expand Down
1 change: 1 addition & 0 deletions test/data/azure/create_openai_whisper_transcriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def make_graph(*args, doc_string=None, **kwargs):
audio_format='wav', # default audio type if filename is not specified.
model_uri='https://api.openai.com/v1/audio/transcriptions',
model_name='whisper-1',
timeout_seconds=20,
verbose=0,
),
],
Expand Down
Binary file modified test/data/azure/openai_whisper_transcriptions.onnx
Binary file not shown.

0 comments on commit d778ace

Please sign in to comment.