Skip to content

Commit

Permalink
chore: remigrate if there is no models dir (#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Dec 15, 2023
1 parent 1fa05cf commit f62b0ca
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit f62b0ca

Please sign in to comment.