Morpheus icon indicating copy to clipboard operation
Morpheus copied to clipboard

Problem opening app if ollama is installed and running (macOS)

Open quertc opened this issue 1 year ago • 6 comments

Version: 0.0.5

How to reproduce:

  • Turn off Ollama.app in the system
  • Open morpheus.app (it will install a new ollama-darwin bin and model in a new folder)
  • Close morpheus.app and enable our Ollama.app
  • Open morpheus.app again and see the eternal loading

Expected behavior:

  • Check if Ollama.app exists on the system
    • If yes install & verify the model through it
    • If not, install ollama and use it

OR

Add ollama conflict error message

quertc avatar Apr 18 '24 22:04 quertc

Hi @quertc Are you running this on an Intel or M chipset?

betterbrand avatar Apr 19 '24 16:04 betterbrand

Hi @quertc Are you running this on an Intel or M chipset?

M

quertc avatar Apr 20 '24 21:04 quertc

Ollama may have updated to it's 1.0 version in during the time between 0.0.5 and 0.0.6. Which version of Ollama are you running?

betterbrand avatar Apr 20 '24 21:04 betterbrand

Ollama may have updated to it's 1.0 version in during the time between 0.0.5 and 0.0.6. Which version of Ollama are you running?

Latest (0.1.32). It doesn't update, it just downloads a new binary. And downloads the models to another folder (chatd).

And version 0.0.6 is the Lite Client, not this Morpheus repo. Lite Client works differently with ollama.

quertc avatar Apr 21 '24 14:04 quertc

const fs = require('fs'); const { exec } = require('child_process');

function initializeMorpheus() { checkOllamaExists().then(exists => { if (exists) { verifyAndInstallModel(); } else { installOllama().then(installModel); } }); }

function checkOllamaExists() { return new Promise(resolve => { fs.exists('/Applications/Ollama.app', exists => { resolve(exists); }); }); }

function verifyAndInstallModel() { // Implement verification logic and model installation if Ollama exists console.log('Verifying and installing model...'); }

function installOllama() { return new Promise((resolve, reject) => { console.log('Installing Ollama...'); exec('brew install ollama', (error, stdout, stderr) => { if (error) { console.error(Error installing Ollama: ${error}); return reject(error); } console.log('Ollama installed successfully'); resolve(); }); }); }

function installModel() { // Code to install the model via Ollama console.log('Installing model...'); }

initializeMorpheus();

devhakeo avatar Apr 23 '24 17:04 devhakeo

This script uses Node.js to check for the presence of Ollama.app, installs it if not present, and ensures that the model is installed or verified accordingly. Adjust the paths and installation commands as needed for your specific setup.

devhakeo avatar Apr 23 '24 17:04 devhakeo