Merge pull request #1418 from github/aeisenberg/resolve-ml-libs
Resolve ml-queries from directory
This commit is contained in:
@@ -606,7 +606,8 @@ export class CodeQLCliServer implements Disposable {
|
||||
/** Resolves the ML models that should be available when evaluating a query. */
|
||||
async resolveMlModels(additionalPacks: string[], queryPath: string): Promise<MlModelsInfo> {
|
||||
const args = await this.cliConstraints.supportsPreciseResolveMlModels()
|
||||
? [...this.getAdditionalPacksArg(additionalPacks), queryPath]
|
||||
// use the dirname of the path so that we can handle query libraries
|
||||
? [...this.getAdditionalPacksArg(additionalPacks), path.dirname(queryPath)]
|
||||
: this.getAdditionalPacksArg(additionalPacks);
|
||||
return await this.runJsonCodeQlCliCommand<MlModelsInfo>(
|
||||
['resolve', 'ml-models'],
|
||||
|
||||
@@ -789,9 +789,7 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
const metadata = await tryGetQueryMetadata(cliServer, qlProgram.queryPath);
|
||||
|
||||
let availableMlModels: cli.MlModelInfo[] = [];
|
||||
if (!initialInfo.queryPath.endsWith('.ql')) {
|
||||
void logger.log('Quick evaluation within a query library does not currently support using ML models. Continuing without any ML models.');
|
||||
} else if (!await cliServer.cliConstraints.supportsResolveMlModels()) {
|
||||
if (!await cliServer.cliConstraints.supportsResolveMlModels()) {
|
||||
void logger.log('Resolving ML models is unsupported by this version of the CLI. Running the query without any ML models.');
|
||||
} else {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user