First commit.
This commit is contained in:
33
index.js
Normal file
33
index.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import ChatModel from "./python_bindings.js";
|
||||
|
||||
const chat = new ChatModel({ "model":"something" });
|
||||
|
||||
//await chat.setProperty( "model", "something");
|
||||
await chat.setProperty( "tokenizer", 123 );
|
||||
|
||||
|
||||
const modelResponse = await chat.getModelPath();
|
||||
console.log(modelResponse); // { model: "something" }
|
||||
|
||||
const tokenizerResponse = await chat.getTokenizer();
|
||||
console.log(tokenizerResponse); // { model: 123 }
|
||||
|
||||
let response = await chat.increment({ by: 5 });
|
||||
console.log("Incremented counter:", response.counter);
|
||||
|
||||
response = await chat.increment({ by: 2 });
|
||||
console.log("Incremented counter:", response.counter);
|
||||
|
||||
response = await chat.increment({ by: 2 });
|
||||
console.log("Incremented counter:", response.counter);
|
||||
|
||||
chat.onMessage( function( data ) {
|
||||
|
||||
console.log( data );
|
||||
|
||||
} );
|
||||
|
||||
chat.testStream();
|
||||
|
||||
chat.end();
|
||||
|
||||
Reference in New Issue
Block a user