MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / AddOSSAccessPrefix

Function AddOSSAccessPrefix

serving/processor/serving/model_config.cc:14–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12namespace {
13constexpr int DEFAULT_CPUS = 8;
14Status AddOSSAccessPrefix(std::string& dir,
15 const ModelConfig* config) {
16 auto offset = dir.find("oss://");
17 // error oss format
18 if (offset == std::string::npos) {
19 return tensorflow::errors::Internal(
20 "Invalid user input oss dir, ", dir);
21 }
22
23 std::string tmp(dir.substr(6));
24 offset = tmp.find("/");
25 if (offset == std::string::npos) {
26 return tensorflow::errors::Internal(
27 "Invalid user input oss dir, ", dir);
28 }
29
30 dir = strings::StrCat(dir.substr(0, offset+6),
31 "\x01id=", config->oss_access_id,
32 "\x02key=", config->oss_access_key,
33 "\x02host=", config->oss_endpoint,
34 tmp.substr(offset));
35 return Status::OK();
36}
37
38void ParseGPUIds(const std::string& gpu_ids_list,
39 std::vector<size_t>* gpu_ids) {

Callers 1

CreateMethod · 0.85

Calls 3

InternalFunction · 0.85
StrCatFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected