MCPcopy
hub / github.com/ModelTC/LightLLM / list

Method list

lightllm/utils/petrel_helper.py:101–115  ·  view source on GitHub ↗
(path, extension="json")

Source from the content-addressed store, hash-verified

99 f.write(data)
100
101 def list(path, extension="json"):
102 if "s3://" not in path:
103 assert os.path.exists(path), f"No such file: {path}"
104 filenames = []
105 for name in os.listdir(path):
106 if name.endswith(extension) or extension == "all":
107 filenames.append(name)
108 return filenames
109 else:
110 contents = PetrelHelper._petrel_helper.client.list(path)
111 filenames = []
112 for name in contents:
113 if name.endswith(extension) or extension == "all":
114 filenames.append(name)
115 return filenames
116
117 def load_pretrain(self, path, map_location=None):
118 if "s3://" not in path:

Callers 4

s3_model_prepareFunction · 0.80
__init__Method · 0.80
load_hf_weightsFunction · 0.80
load_hf_weightsFunction · 0.80

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected