-
Notifications
You must be signed in to change notification settings - Fork 410
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
Windows install can't download Ollama #318
Comments
To resolve the issue with downloading Ollama on Windows, update the
win32: {
url: "https://github.com/ollama/ollama/releases/download/v0.1.48/ollama-windows-amd64.zip",
path: "../binaries/win32/ollama-windows-amd64.zip",
},
const unzip = require('unzipper');
function downloadIfMissing(platformKey) {
const info = binariesInfo[platformKey];
const filePath = path.join(__dirname, info.path);
ensureDirectoryExistence(filePath);
fs.access(filePath, fs.constants.F_OK, (err) => {
if (err) {
console.log(`Downloading ${platformKey} Ollama binary...`);
const request = https.get(info.url, (response) => {
if (response.statusCode === 200) {
const file = fs.createWriteStream(filePath);
response.pipe(file);
file.on('finish', () => {
file.close(async () => {
console.log(`Downloaded ${platformKey} Ollama binary.`);
if (platformKey === 'win32') {
await fs.createReadStream(filePath).pipe(unzip.Extract({ path: path.dirname(filePath) }));
fs.unlinkSync(filePath); // Remove the zip file after extraction
} else {
setExecutable(filePath);
}
});
});
} else if (response.statusCode === 302 || response.statusCode === 301) {
console.log(`Redirection to ${response.headers.location}`);
binariesInfo[platformKey].url = response.headers.location;
downloadIfMissing(platformKey);
} else {
console.error(`Failed to download ${platformKey} binary. Status code: ${response.statusCode}`);
}
});
request.on('error', (error) => {
console.error(`Error downloading ${platformKey} binary: ${error.message}`);
});
} else {
console.log(`${platformKey} Ollama binary already exists.`);
if (platformKey !== 'win32') {
setExecutable(filePath);
}
}
});
}
case 'win32':
exeName = 'ollama-windows-amd64.exe';
exeDir = app.isPackaged
? path.join(process.resourcesPath, 'binaries')
: path.join(app.getAppPath(), 'binaries', 'win32');
break; These changes should address the issue with downloading and extracting the Ollama binary on Windows. References/scripts/downloadOllama.js
|
Is that an AI written response or a known issue at the moment lol |
It's an AI. I am not using Windows, sorry I can't help you with that... |
Describe the bug
downloadOllama.js windows absolute url 404's.
To Reproduce
I don't expect the following to work either, but here's what I get when trying to add a local llm:
cursory investigation leads me to the downloadOllama script and it looks for a exe but ollama switched to serving zips at some point for windows.
I downloaded the zip manually and tossed the contents in resources/binaries and things appear to be working. I renamed the exe to
ollama-windows-amd64.exe
.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: