should be done now.
This commit is contained in:
parent
e4c5e2e634
commit
7c3cfe879f
1 changed files with 11 additions and 8 deletions
19
index.mjs
19
index.mjs
|
@ -31,7 +31,7 @@ function ask(q) {
|
|||
ans = a
|
||||
rl.close();
|
||||
});
|
||||
|
||||
return ans
|
||||
}
|
||||
|
||||
// Function to run the publishing commands
|
||||
|
@ -205,6 +205,11 @@ async function generateModelfile(c) {
|
|||
console.error('Error writing file:', err);
|
||||
});
|
||||
ags_modelfile += ags_template_finalpart;
|
||||
await writeFile(modelfilePath, ags_modelfile)
|
||||
.then(() => {})
|
||||
.catch(err => {
|
||||
console.error('Error writing file:', err);
|
||||
});
|
||||
return ags_modelfile;
|
||||
}
|
||||
|
||||
|
@ -216,11 +221,6 @@ async function learner() {
|
|||
//await contextAdd(["tea.texas.gov/student-assessment/staar/released-test-questions/2024-staar-algebra-i-answer-key.pdf", "tea.texas.gov/student-assessment/staar/released-test-questions/2024-staar-english-ii-answer-key.pdf", "tea.texas.gov/student-assessment/staar/released-test-questions/2024-staar-biology-answer-key.pdf", "tea.texas.gov/student-assessment/staar/released-test-questions/2024-staar-us-history-answer-key.pdf"])
|
||||
const modelfile = await generateModelfile(contexts);
|
||||
console.log(modelfile);
|
||||
await writeFile(modelfilePath, modelfile)
|
||||
.then(() => {})
|
||||
.catch(err => {
|
||||
console.error('Error writing file:', err);
|
||||
});
|
||||
runPublishCommands();
|
||||
return 0
|
||||
} catch (error) {
|
||||
|
@ -241,12 +241,15 @@ async function learningLoop() {
|
|||
async function talkLoop() {
|
||||
while (true) {
|
||||
let q = await ask(`To ${modelID}: `)
|
||||
userAGIInput += `USER: ${q}`;
|
||||
userAGIInput += await `
|
||||
USER: ${q}`;
|
||||
let a = await ollama.chat({
|
||||
model: `${modelID}`,
|
||||
messages: [{ role: 'user', content: `${q}` }],
|
||||
})
|
||||
userAGIInput += `AI: ${a.message.content}`;
|
||||
userAGIInput += await `
|
||||
|
||||
AI: ${a.message.content}`;
|
||||
console.log(`${a.message.content}`)
|
||||
generateModelfile(contexts)
|
||||
runPublishCommands()
|
||||
|
|
Loading…
Reference in a new issue