MCPcopy Create free account
hub / github.com/modelscope/modelscope / encode_url_or_file_to_base64

Function encode_url_or_file_to_base64

modelscope/utils/service_utils.py:132–138  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

130
131
132def encode_url_or_file_to_base64(path):
133 try:
134 requests.get(path)
135 return encode_url_to_base64(path)
136 except (requests.exceptions.MissingSchema,
137 requests.exceptions.InvalidSchema):
138 return encode_file_to_base64(path)
139
140
141def service_data_decoder(task, data):

Callers

nothing calls this directly

Calls 3

encode_url_to_base64Function · 0.85
encode_file_to_base64Function · 0.85
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…