MCPcopy Create free account
hub / github.com/apple/coremltools / createItemInfoEntry

Method createItemInfoEntry

modelpackage/src/ModelPackage.cpp:353–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353void ModelPackageImpl::createItemInfoEntry(const std::string& identifier, const std::string& path, const std::string& name, const std::string& author, const std::string& description) {
354 auto itemInfoEntry = getItemInfoEntry(identifier);
355
356 if (nullptr == itemInfoEntry) {
357 itemInfoEntry = std::make_unique<JsonMap>();
358 }
359
360 itemInfoEntry->setString(kModelPackageItemInfoPathKey, path);
361 itemInfoEntry->setString(kModelPackageItemInfoNameKey, name);
362 itemInfoEntry->setString(kModelPackageItemInfoAuthorKey, author);
363 itemInfoEntry->setString(kModelPackageItemInfoDescriptionKey, description);
364
365 auto itemInfoEntries = getItemInfoEntries();
366 itemInfoEntries->setObject(identifier, std::move(itemInfoEntry));
367 m_manifest->setObject(kModelPackageItemInfoEntriesKey, std::move(itemInfoEntries));
368}
369
370std::filesystem::path ModelPackageImpl::getItemPath(const std::string& name, const std::string& author) const {
371 return std::filesystem::path(author) / name;

Callers

nothing calls this directly

Calls 3

moveFunction · 0.85
setObjectMethod · 0.80
setStringMethod · 0.45

Tested by

no test coverage detected