Skip to content

Commit

Permalink
Display 'installing' icon when installing ollama via script/homebrew
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Oct 15, 2024
1 parent 79bda8a commit 462d5cb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The following Ollama installation options are available :
2. **Install with Script:** Available on Linux.
3. **Install Manually:** Supported on all platforms. If you choose this option, you will be redirected to the official [Ollama download page](https://ollama.com/download) to complete the installation.

Once Ollama is installed, the page will refresh automatically.
Once Ollama is installed, the page will refresh automatically. Depending on the security settings of your plateform, you may need to start Ollama manually the first time.

![installollama](media/installollama.gif)

Expand Down
Binary file modified media/installmodels.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/installollama.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions src/ollama/ollamaServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export class OllamaServer implements IModelServer {
this.currentStatus = ServerStatus.started;
} else {
const ollamaInstalled = await this.isServerInstalled();
this.currentStatus = (ollamaInstalled) ? ServerStatus.stopped : ServerStatus.missing;
if (this.currentStatus !== ServerStatus.installing) {
this.currentStatus = (ollamaInstalled) ? ServerStatus.stopped : ServerStatus.missing;
}
}
return this.currentStatus;
}
Expand Down Expand Up @@ -89,6 +91,7 @@ export class OllamaServer implements IModelServer {
async installServer(mode: string): Promise<boolean> {
switch (mode) {
case "homebrew": {
this.currentStatus = ServerStatus.installing; //We need to detect the terminal output to know when installation stopped (successfully or not)
await terminalCommandRunner.runInTerminal(
"clear && brew install --cask ollama && sleep 3 && ollama list", //run ollama list to trigger the ollama daemon
{
Expand All @@ -99,7 +102,8 @@ export class OllamaServer implements IModelServer {
return true;
}
case "script":
await terminalCommandRunner.runInTerminal(
this.currentStatus = ServerStatus.installing;
await terminalCommandRunner.runInTerminal(//We need to detect the terminal output to know when installation stopped (successfully or not)
"clear && curl -fsSL https://ollama.com/install.sh | sh",
{
name: "Granite Code Setup",
Expand Down

0 comments on commit 462d5cb

Please sign in to comment.