Skip to content

Commit 4b94f9b

Browse files
committed
Version 0.1.2: fixes
1 parent 1493f28 commit 4b94f9b

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "modprompt",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Prompt templates for language models",
55
"license": "MIT",
66
"scripts": {

src/cls.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,23 @@ class PromptTemplate {
8282
user: this.user,
8383
assistant: this.assistant,
8484
}
85+
if (this?.prefix) {
86+
res.prefix = this.prefix
87+
}
8588
if (this?.system) {
86-
this.system = this.system
89+
res.system = this.system
8790
}
8891
if (this?.shots) {
89-
this.shots = this.shots
92+
res.shots = this.shots
93+
}
94+
if (this?.afterShot) {
95+
res.afterShot = this.afterShot
9096
}
9197
if (this?.stop) {
92-
this.stop = this.stop
98+
res.stop = this.stop
9399
}
94100
if (this?.linebreaks) {
95-
this.linebreaks = this.linebreaks
101+
res.linebreaks = this.linebreaks
96102
}
97103
return res
98104
}

src/db.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,7 @@ const templates: Record<string, LmTemplate> = {
3535
"user": 0
3636
},
3737
"prefix": "<s>",
38-
},
39-
"llama_instruct": {
40-
"id": "llama_instruct",
41-
"name": "Llama instruct",
42-
"user": "[INST] {prompt}",
43-
"assistant": " [/INST]",
44-
"linebreaks": {
45-
"user": 1
46-
},
38+
"stop": ["</s>"],
4739
},
4840
"amazon": {
4941
"id": "amazon",

0 commit comments

Comments
 (0)