Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Lmdeploy
Commits
baf1801b
Unverified
Commit
baf1801b
authored
Oct 23, 2023
by
AllentDan
Committed by
GitHub
Oct 23, 2023
Browse files
update solar chat template (#587)
parent
186bfd2e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
lmdeploy/model.py
lmdeploy/model.py
+7
-7
No files found.
lmdeploy/model.py
View file @
baf1801b
...
...
@@ -585,9 +585,9 @@ class SOLAR(BaseModel):
def
__init__
(
self
,
b_sys
=
'### System:
\n
'
,
e_sys
=
'
\n\n
'
,
boh
=
'### User:
\n
'
,
user
=
'### User:
\n
'
,
eoh
=
'
\n\n
'
,
boa
=
'### Assistant:
\n
'
,
assistant
=
'### Assistant:
\n
'
,
eoa
=
'
\n\n
'
,
system
=
''
,
session_len
=
2048
,
...
...
@@ -595,9 +595,9 @@ class SOLAR(BaseModel):
super
().
__init__
(
**
kwargs
)
self
.
b_sys
=
b_sys
self
.
e_sys
=
e_sys
self
.
boh
=
boh
self
.
user
=
user
self
.
eoh
=
eoh
self
.
boa
=
boa
self
.
assistant
=
assistant
self
.
eoa
=
eoa
self
.
system
=
system
self
.
session_len
=
session_len
...
...
@@ -617,9 +617,9 @@ class SOLAR(BaseModel):
f
'
{
type
(
self
).
__name__
}
has no capability of
{
self
.
capability
}
'
if
sequence_start
:
return
f
'
{
self
.
b_sys
}{
self
.
system
}{
self
.
e_sys
}
'
\
f
'
{
self
.
boh
}{
prompt
}{
self
.
eoh
}{
self
.
boa
}
'
f
'
{
self
.
user
}{
prompt
}{
self
.
eoh
}{
self
.
assistant
}
'
return
f
'
{
self
.
boh
}{
prompt
}
{
self
.
eoh
}{
self
.
boa
}
'
return
f
'
{
self
.
user
}{
prompt
}{
self
.
eoh
}{
self
.
assistant
}
'
def
messages2prompt
(
self
,
messages
,
sequence_start
=
True
):
"""Return the prompt that is concatenated with other elements in the
...
...
@@ -636,7 +636,7 @@ class SOLAR(BaseModel):
system
=
self
.
system
if
not
system
else
system
ret
=
f
'
{
self
.
b_sys
}{
system
}{
self
.
e_sys
}
'
for
i
,
(
user
,
assistant
)
in
enumerate
(
zip
(
users
,
assistants
)):
ret
+=
f
'
{
self
.
boh
}{
user
}{
self
.
eoh
}{
self
.
boa
}
'
ret
+=
f
'
{
self
.
user
}{
user
}{
self
.
eoh
}{
self
.
assistant
}
'
if
assistant
:
ret
+=
f
'
{
assistant
}{
self
.
eoa
}
'
return
ret
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment