MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / get_target

Function get_target

ui/easydiffusion/backends/sdkit3.py:193–224  ·  view source on GitHub ↗

Get the target for the build.

()

Source from the content-addressed store, hash-verified

191
192
193def get_target():
194 """Get the target for the build."""
195 config = getConfig()
196 backend_config = config.get("backend_config") or {}
197
198 def get_os():
199 """Get OS name for target."""
200 if OS_NAME == "Windows":
201 return "win"
202 elif OS_NAME == "Darwin":
203 return "mac"
204 elif OS_NAME == "Linux":
205 return "linux"
206 else:
207 return OS_NAME.lower()
208
209 def get_arch():
210 """Get architecture for target."""
211 machine = platform.machine().lower()
212 if machine in ("x86_64", "amd64"):
213 return "x64"
214 elif machine in ("arm64", "aarch64"):
215 return "arm64"
216 else:
217 return machine
218
219 platform_name = backend_config.get("platform", get_platform_name())
220 variant_name = backend_config.get("variant", get_variant_name(platform_name))
221
222 target = f"{get_os()}-{get_arch()}-{platform_name}-{variant_name}"
223
224 return target
225
226
227def get_platform_name():

Callers 2

get_backend_dirFunction · 0.85
update_backendFunction · 0.85

Calls 6

getConfigFunction · 0.90
get_platform_nameFunction · 0.85
get_variant_nameFunction · 0.85
get_osFunction · 0.85
get_archFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected