Skip to content

Commit

Permalink
fallback to manual download if HF download fails
Browse files Browse the repository at this point in the history
  • Loading branch information
samlhuillier committed Feb 25, 2024
1 parent 0e322d4 commit 5d1518b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions electron/main/database/Embeddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,10 @@ export async function createEmbeddingFunctionForRepo(
env.allowRemoteModels = true;
functionName = embeddingModelConfig.repoName;
try {
console.log("DOWNLOADING");
await DownloadModelFilesFromHFRepo(repoName, env.cacheDir);
console.log("FINISHED DOWNLOADING");
pipe = (await pipeline("feature-extraction", repoName)) as Pipeline;
console.log("PIPELINE INITIALIZED");
} catch (error) {
// here we could run a catch and try manually downloading the model...And perhaps we could start to think about issues that could arise with the
// directory already existing or something like that...
try {
await DownloadModelFilesFromHFRepo(repoName, env.cacheDir); // try to manual download to use system proxy
pipe = (await pipeline("feature-extraction", repoName)) as Pipeline;
} catch (error) {
throw new Error(
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "reor-project",
"version": "0.1.49",
"version": "0.1.50",
"productName": "Reor",
"main": "dist-electron/main/index.js",
"description": "A private & self-organizing note-taking app.",
"description": "An AI note-taking app that runs models locally.",
"author": "Sam L'Huillier",
"license": "GPL-3.0",
"license": "AGPL-3.0",
"private": false,
"debug": {
"env": {
Expand Down

0 comments on commit 5d1518b

Please sign in to comment.