Skip to content

Commit

Permalink
Ignore TS erros
Browse files Browse the repository at this point in the history
  • Loading branch information
machadoum committed Jul 17, 2024
1 parent 75d916c commit 86c9d6b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ export const useEntityModel = () => {
body: JSON.stringify(entityDefinition),
})
.then((response) => {
// eslint-disable-next-line no-console
console.log(response);
});
}, [http]);

const get = useCallback(() => {
// eslint-disable-next-line no-console
console.log('Getting entity model');

if (!http) return Promise.resolve([]);
Expand All @@ -50,6 +52,7 @@ export const useEntityModel = () => {
}, [http]);

const deleteAPI = useCallback(() => {
// eslint-disable-next-line no-console
console.log('Deleting entity model');

if (!http) return Promise.resolve([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,36 +61,43 @@ const createComponentTemplate = async (http: HttpSetup) =>
});

const installModelSettings = async (http: HttpSetup) => {
// eslint-disable-next-line no-console
console.log('create ingest pipeline');
await createIngestPipelineAPI(http);

// eslint-disable-next-line no-console
console.log('create component template');
await createComponentTemplate(http);
};

const installModel = async (http: HttpSetup) => {
const [model] = await getModelAPI(http);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const [model] = (await getModelAPI(http)) as [any];
if (model) {
// eslint-disable-next-line no-console
console.log('-------------- model already installed');
} else {
// eslint-disable-next-line no-console
console.log('install model api call');
await installModelAPI(http);
}

// eslint-disable-next-line no-console
console.log('await for model to be ready');
await waitForModelInstallation(http);

// eslint-disable-next-line no-console
console.log('deploy model api call');
await deployModelAPI(http);
};

const waitForModelInstallation = async (http: HttpSetup) => {
let [tempModel] = await getModelAPI(http);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let [tempModel] = (await getModelAPI(http)) as [any];

while (!tempModel.fully_defined) {
// eslint-disable-next-line no-console
console.log('waiting 2 seconds for model installation...');
await new Promise((resolve) => setTimeout(resolve, 2000)); // wait 2 seconds
[tempModel] = await getModelAPI(http);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[tempModel] = (await getModelAPI(http)) as [any];
}
};

Expand Down

0 comments on commit 86c9d6b

Please sign in to comment.