File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -606,7 +606,8 @@ export class CodeQLCliServer implements Disposable {
606606 /** Resolves the ML models that should be available when evaluating a query. */
607607 async resolveMlModels ( additionalPacks : string [ ] , queryPath : string ) : Promise < MlModelsInfo > {
608608 const args = await this . cliConstraints . supportsPreciseResolveMlModels ( )
609- ? [ ...this . getAdditionalPacksArg ( additionalPacks ) , queryPath ]
609+ // use the dirname of the path so that we can handle query libraries
610+ ? [ ...this . getAdditionalPacksArg ( additionalPacks ) , path . dirname ( queryPath ) ]
610611 : this . getAdditionalPacksArg ( additionalPacks ) ;
611612 return await this . runJsonCodeQlCliCommand < MlModelsInfo > (
612613 [ 'resolve' , 'ml-models' ] ,
Original file line number Diff line number Diff line change @@ -789,9 +789,7 @@ export async function compileAndRunQueryAgainstDatabase(
789789 const metadata = await tryGetQueryMetadata ( cliServer , qlProgram . queryPath ) ;
790790
791791 let availableMlModels : cli . MlModelInfo [ ] = [ ] ;
792- if ( ! initialInfo . queryPath . endsWith ( '.ql' ) ) {
793- void logger . log ( 'Quick evaluation within a query library does not currently support using ML models. Continuing without any ML models.' ) ;
794- } else if ( ! await cliServer . cliConstraints . supportsResolveMlModels ( ) ) {
792+ if ( ! await cliServer . cliConstraints . supportsResolveMlModels ( ) ) {
795793 void logger . log ( 'Resolving ML models is unsupported by this version of the CLI. Running the query without any ML models.' ) ;
796794 } else {
797795 try {
You can’t perform that action at this time.
0 commit comments