Skip to content
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

models.gguf stored in models file, & tsconfig changes for ref @eliza/core & other things #224

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading