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

chore: remigrate if there is no models dir #1038

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions extensions/model-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export default class JanModelExtension implements ModelExtension {

private async copyModelsToHomeDir() {
try {
if (localStorage.getItem(`${EXTENSION_NAME}-version`) === VERSION) {
if (
localStorage.getItem(`${EXTENSION_NAME}-version`) === VERSION &&
(await fs.exists(JanModelExtension._homeDir))
) {
console.debug('Model already migrated')
return
}
Expand All @@ -63,9 +66,7 @@ export default class JanModelExtension implements ModelExtension {
const reconfigureModels = (await this.getConfiguredModels()).filter((e) =>
readyModels.includes(e.id)
)
console.debug(
'Finished updating downloaded models'
)
console.debug('Finished updating downloaded models')

// update back the status
await Promise.all(
Expand Down
Loading