Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: getLocalModels returns an empty array if the models folder does not exist #117

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Jan 23, 2024

Fixes #113

Copy link
Contributor

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const manager = new ModelsManager('/home/user/aistudio');
const models = manager.getLocalModels();
expect(models).toEqual([]);
expect(existsSyncSpy).toHaveBeenCalledWith('/home/user/aistudio/models');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks it's duplicating line 64

so maybe line 62-65 should just be

existsSyncSpy.mockReturnValue(false);

@feloy feloy force-pushed the fix-check-models-folder-main branch from 0bdd99d to 71c53fd Compare January 23, 2024 11:05
@feloy feloy force-pushed the fix-check-models-folder-main branch from 71c53fd to 6dc378f Compare January 23, 2024 11:11
@feloy feloy merged commit 984fe48 into main Jan 23, 2024
3 checks passed
@feloy feloy deleted the fix-check-models-folder-main branch January 23, 2024 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Downloading a model fails when the models folder does not exist
3 participants