File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export async function callCloudOrDevice<Response>(
5959 }
6060 throw new AIError (
6161 AIErrorCode . UNSUPPORTED ,
62- 'On -device model is not available.'
62+ 'Inference mode is ONLY_ON_DEVICE, but an on -device model is not available.'
6363 ) ;
6464 case InferenceMode . ONLY_IN_CLOUD :
6565 return inCloudCall ( ) ;
@@ -72,10 +72,12 @@ export async function callCloudOrDevice<Response>(
7272 }
7373 throw e ;
7474 }
75- default : // PREFER_ON_DEVICE
75+ case InferenceMode . PREFER_ON_DEVICE :
7676 if ( await chromeAdapter . isAvailable ( request ) ) {
7777 return onDeviceCall ( ) ;
7878 }
7979 return inCloudCall ( ) ;
80+ default :
81+ throw new AIError ( AIErrorCode . Error , `Unexpected infererence mode: ${ ( chromeAdapter as ChromeAdapterImpl ) . mode } ` ) ;
8082 }
8183}
You can’t perform that action at this time.
0 commit comments