File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " modprompt" ,
3
- "version" : " 0.1.1 " ,
3
+ "version" : " 0.1.2 " ,
4
4
"description" : " Prompt templates for language models" ,
5
5
"license" : " MIT" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -82,17 +82,23 @@ class PromptTemplate {
82
82
user : this . user ,
83
83
assistant : this . assistant ,
84
84
}
85
+ if ( this ?. prefix ) {
86
+ res . prefix = this . prefix
87
+ }
85
88
if ( this ?. system ) {
86
- this . system = this . system
89
+ res . system = this . system
87
90
}
88
91
if ( this ?. shots ) {
89
- this . shots = this . shots
92
+ res . shots = this . shots
93
+ }
94
+ if ( this ?. afterShot ) {
95
+ res . afterShot = this . afterShot
90
96
}
91
97
if ( this ?. stop ) {
92
- this . stop = this . stop
98
+ res . stop = this . stop
93
99
}
94
100
if ( this ?. linebreaks ) {
95
- this . linebreaks = this . linebreaks
101
+ res . linebreaks = this . linebreaks
96
102
}
97
103
return res
98
104
}
Original file line number Diff line number Diff line change @@ -35,15 +35,7 @@ const templates: Record<string, LmTemplate> = {
35
35
"user" : 0
36
36
} ,
37
37
"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>" ] ,
47
39
} ,
48
40
"amazon" : {
49
41
"id" : "amazon" ,
You can’t perform that action at this time.
0 commit comments