File tree Expand file tree Collapse file tree
packages/react-native-executorch/src/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { ResourceSource } from '../types/common' ;
22import { RnExecutorchError } from '../errors/errorUtils' ;
33import { RnExecutorchErrorCode } from '../errors/ErrorCodes' ;
4+ import { ResourceFetcherUtils } from './ResourceFetcherUtils' ;
45
56/**
67 * Adapter interface for resource fetching operations.
@@ -105,6 +106,15 @@ export class ResourceFetcher {
105106 callback : ( downloadProgress : number ) => void = ( ) => { } ,
106107 ...sources : ResourceSource [ ]
107108 ) {
109+ for ( const source of sources ) {
110+ if ( typeof source === 'string' ) {
111+ try {
112+ ResourceFetcherUtils . triggerHuggingFaceDownloadCounter ( source ) ;
113+ } catch ( error ) {
114+ throw error ;
115+ }
116+ }
117+ }
108118 return this . getAdapter ( ) . fetch ( callback , ...sources ) ;
109119 }
110120
You can’t perform that action at this time.
0 commit comments