Checks if a custom global resource provider is used as the first step of loading the model resources on all platforms.
PiperOrigin-RevId: 493141519
This commit is contained in:
committed by
Copybara-Service
parent
99d1dd6fbb
commit
1e76d47a71
@@ -37,6 +37,8 @@ absl::Status GetResourceContents(const std::string& path, std::string* output,
|
||||
return internal::DefaultGetResourceContents(path, output, read_as_binary);
|
||||
}
|
||||
|
||||
bool HasCustomGlobalResourceProvider() { return resource_provider_ != nullptr; }
|
||||
|
||||
void SetCustomGlobalResourceProvider(ResourceProviderFn fn) {
|
||||
resource_provider_ = std::move(fn);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ namespace mediapipe {
|
||||
typedef std::function<absl::Status(const std::string&, std::string*)>
|
||||
ResourceProviderFn;
|
||||
|
||||
// Returns true if files are provided via a custom resource provider.
|
||||
bool HasCustomGlobalResourceProvider();
|
||||
|
||||
// Overrides the behavior of GetResourceContents.
|
||||
void SetCustomGlobalResourceProvider(ResourceProviderFn fn);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user