MCPcopy Create free account
hub / github.com/modelscope/FunASR / _resolve_ncpu

Function _resolve_ncpu

funasr/auto/auto_model.py:44–51  ·  view source on GitHub ↗

Return a positive integer representing CPU threads from config.

(config, fallback=4)

Source from the content-addressed store, hash-verified

42
43
44def _resolve_ncpu(config, fallback=4):
45 """Return a positive integer representing CPU threads from config."""
46 value = config.get("ncpu", fallback)
47 try:
48 value = int(value)
49 except (TypeError, ValueError):
50 value = fallback
51 return max(value, 1)
52
53
54def _get_import_errors():

Callers 2

build_modelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…