diff --git a/mediapipe/tasks/web/core/fileset_resolver.ts b/mediapipe/tasks/web/core/fileset_resolver.ts index ae17c577..5c845b80 100644 --- a/mediapipe/tasks/web/core/fileset_resolver.ts +++ b/mediapipe/tasks/web/core/fileset_resolver.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -// Placeholder for internal dependency on trusted resource URL builder +// Placeholder for internal dependency on resourceUrlSafeByReview import {WasmFileset} from './wasm_fileset'; @@ -30,6 +30,9 @@ const WASM_SIMD_CHECK = new Uint8Array([ 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11 ]); +/** The categories of tasks supported by MediaPipe. */ +type MediapipeTaskCategory = 'audio'|'text'|'vision'; + async function isSimdSupported(): Promise { if (supportsSimd === undefined) { try { @@ -44,7 +47,7 @@ async function isSimdSupported(): Promise { } async function createFileset( - taskName: string, basePath = ''): Promise { + taskName: MediapipeTaskCategory, basePath = ''): Promise { const suffix = await isSimdSupported() ? 'wasm_internal' : 'wasm_nosimd_internal';