Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/treelite/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ TREELITE_DLL int TreeliteLoadXGBoostModelUBJSON(
* \return 0 for success, -1 for failure
*/
TREELITE_DLL int TreeliteLoadXGBoostModelFromUBJSONString(
uint8_t const* ubjson_str, size_t length, char const* config_json, TreeliteModelHandle* out);
char const* ubjson_str, size_t length, char const* config_json, TreeliteModelHandle* out);
/*!
* \brief Inspect the first few bytes of an XGBoost model and heuristically determine whether
* it's using the JSON or UBJSON format.
Expand Down
2 changes: 1 addition & 1 deletion include/treelite/model_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ std::unique_ptr<treelite::Model> LoadXGBoostModelUBJSON(
* \return Loaded model
*/
std::unique_ptr<treelite::Model> LoadXGBoostModelFromUBJSONString(
std::basic_string_view<std::uint8_t> ubjson_str, std::string const& config_json);
std::string_view ubjson_str, std::string const& config_json);

/*!
* \brief Inspect the first few bytes of an XGBoost model and heuristically determine whether
Expand Down
6 changes: 3 additions & 3 deletions src/c_api/model_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ int TreeliteLoadXGBoostModelUBJSON(
API_END();
}

int TreeliteLoadXGBoostModelFromUBJSONString(std::uint8_t const* ubjson_str, std::size_t length,
char const* config_json, TreeliteModelHandle* out) {
int TreeliteLoadXGBoostModelFromUBJSONString(
char const* ubjson_str, std::size_t length, char const* config_json, TreeliteModelHandle* out) {
API_BEGIN();
std::unique_ptr<treelite::Model> model = treelite::model_loader::LoadXGBoostModelFromUBJSONString(
std::basic_string_view<std::uint8_t>{ubjson_str, length}, config_json);
std::string_view{ubjson_str, length}, config_json);
*out = static_cast<TreeliteModelHandle>(model.release());
API_END();
}
Expand Down
2 changes: 1 addition & 1 deletion src/model_loader/xgboost_ubjson.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ std::unique_ptr<treelite::Model> LoadXGBoostModelUBJSON(
}

std::unique_ptr<treelite::Model> LoadXGBoostModelFromUBJSONString(
std::basic_string_view<std::uint8_t> ubjson_str, std::string const& config_json) {
std::string_view ubjson_str, std::string const& config_json) {
nlohmann::json parsed_config = nlohmann::json::parse(config_json);
return ParseStream(ubjson_str, parsed_config);
}
Expand Down
Loading