Skip to content

Commit

Permalink
Merge pull request #224 from o-on-x/main
Browse files Browse the repository at this point in the history
models.gguf stored in models file, & tsconfig changes for ref @eliza/core & other things
  • Loading branch information
lalalune authored Nov 7, 2024
2 parents 5764572 + 1d551e2 commit d1683bd
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ embedding-cache.json
.DS_Store

dist/
# Allow models directory but ignore model files
models/*.gguf

cookies.json

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
},
"engines": {
"node": ">=22"
},
"dependencies": {
"ollama-ai-provider": "^0.16.1",
"optional": "^0.1.4",
"sharp": "^0.33.5"
}
}
2 changes: 1 addition & 1 deletion packages/agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
walletProvider,
} from "@eliza/core";
import readline from "readline";

console.log("Program starting")
const args = parseArguments();

let charactersArg = args.characters || args.character;
Expand Down
13 changes: 10 additions & 3 deletions packages/agent/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"rootDir": ".",
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["node"]
},
"include": ["."]
}
"include": ["src"],
"references": [
{ "path": "../core" }
]
}
6 changes: 3 additions & 3 deletions packages/core/src/services/LlamaCppService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class LlamaCppService {
this.modelUrl =
"https://huggingface.co/NousResearch/Hermes-3-Llama-3.1-8B-GGUF/resolve/main/Hermes-3-Llama-3.1-8B.Q8_0.gguf?download=true";
const modelName = "model.gguf";
this.modelPath = path.join(__dirname, modelName);
// in packages/core/src/services/LlamaCppService.ts
this.modelPath = path.join(__dirname, '../models/model.gguf');
}

public static getInstance(): LlamaCppService {
Expand Down Expand Up @@ -148,11 +149,10 @@ class LlamaCppService {
}

async checkModel() {
console.log("Checking model");
console.log("Checking model")
if (!fs.existsSync(this.modelPath)) {
console.log("this.modelPath", this.modelPath);
console.log("Model not found. Downloading...");

await new Promise<void>((resolve, reject) => {
const file = fs.createWriteStream(this.modelPath);
let downloadedSize = 0;
Expand Down
21 changes: 18 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d1683bd

Please sign in to comment.