microsoft / onnxruntime-genai

Generative AI extensions for onnxruntime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ort::InitApi() is only called after Generator related code is invoked

skyline75489 opened this issue · comments

OrtEnv is created at

static bool _ = (Ort::InitApi(), false);

Calling other APIs before initializing OrtEnv:

import onnxruntime_genai as ort_genai
ort_genai.get_current_gpu_device_id()

Will fail:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
onnxruntime_genai.onnxruntime_genai.OrtException: /onnxruntime_src/include/onnxruntime/core/common/logging/logging.h:320 static const onnxruntime::logging::Logger& onnxruntime::logging::LoggingManager::DefaultLogger() Attempt to use DefaultLogger but none has been registered.