symposium 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Model.js +3 -1
- package/Summarizer.js +1 -1
- package/Symposium.js +1 -1
- package/package.json +1 -1
package/Model.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
class Model {
|
|
2
2
|
name;
|
|
3
|
+
name_for_tiktoken;
|
|
3
4
|
label;
|
|
4
5
|
tokens;
|
|
5
6
|
|
|
6
|
-
constructor(name, label, tokens) {
|
|
7
|
+
constructor(name, label, tokens, name_for_tiktoken = null) {
|
|
7
8
|
this.name = name;
|
|
8
9
|
this.label = label;
|
|
9
10
|
this.tokens = tokens;
|
|
11
|
+
this.name_for_tiktoken = name_for_tiktoken || name;
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
14
|
|
package/Summarizer.js
CHANGED
|
@@ -14,7 +14,7 @@ class Summarizer extends MemoryHandler {
|
|
|
14
14
|
if (!model)
|
|
15
15
|
return conversation;
|
|
16
16
|
|
|
17
|
-
const encoder = encoding_for_model(model.
|
|
17
|
+
const encoder = encoding_for_model(model.name_for_tiktoken);
|
|
18
18
|
const tokens = this.countTokens(encoder, conversation);
|
|
19
19
|
if (tokens >= model.tokens * this.threshold)
|
|
20
20
|
return await this.summarize(encoder, conversation, model.tokens * this.summary_length);
|
package/Symposium.js
CHANGED
|
@@ -9,7 +9,7 @@ class Symposium {
|
|
|
9
9
|
static async init() {
|
|
10
10
|
this.loadModel(new Model('gpt-3.5-turbo-16k', 'gpt-3.5', 16384));
|
|
11
11
|
this.loadModel(new Model('gpt-4', 'gpt-4', 8192));
|
|
12
|
-
this.loadModel(new Model('gpt-4-1106-preview', 'gpt-4-turbo', 128000));
|
|
12
|
+
this.loadModel(new Model('gpt-4-1106-preview', 'gpt-4-turbo', 128000, 'gpt-4'));
|
|
13
13
|
|
|
14
14
|
return Redis.init();
|
|
15
15
|
}
|