Update conversation.py
Browse files- conversation.py +0 -43
conversation.py
CHANGED
@@ -1241,46 +1241,3 @@ register_conv_template(
|
|
1241 |
stop_str='<|endoftext|>',
|
1242 |
)
|
1243 |
)
|
1244 |
-
|
1245 |
-
|
1246 |
-
if __name__ == '__main__':
|
1247 |
-
from fastchat.conversation import get_conv_template
|
1248 |
-
|
1249 |
-
print('-- Vicuna template --')
|
1250 |
-
conv = get_conv_template('vicuna_v1.1')
|
1251 |
-
conv.append_message(conv.roles[0], 'Hello!')
|
1252 |
-
conv.append_message(conv.roles[1], 'Hi!')
|
1253 |
-
conv.append_message(conv.roles[0], 'How are you?')
|
1254 |
-
conv.append_message(conv.roles[1], None)
|
1255 |
-
print(conv.get_prompt())
|
1256 |
-
|
1257 |
-
print('\n')
|
1258 |
-
|
1259 |
-
print('-- Llama-2 template --')
|
1260 |
-
conv = get_conv_template('llama-2')
|
1261 |
-
conv.set_system_message('You are a helpful, respectful and honest assistant.')
|
1262 |
-
conv.append_message(conv.roles[0], 'Hello!')
|
1263 |
-
conv.append_message(conv.roles[1], 'Hi!')
|
1264 |
-
conv.append_message(conv.roles[0], 'How are you?')
|
1265 |
-
conv.append_message(conv.roles[1], None)
|
1266 |
-
print(conv.get_prompt())
|
1267 |
-
|
1268 |
-
print('\n')
|
1269 |
-
|
1270 |
-
print('-- ChatGPT template --')
|
1271 |
-
conv = get_conv_template('chatgpt')
|
1272 |
-
conv.append_message(conv.roles[0], 'Hello!')
|
1273 |
-
conv.append_message(conv.roles[1], 'Hi!')
|
1274 |
-
conv.append_message(conv.roles[0], 'How are you?')
|
1275 |
-
conv.append_message(conv.roles[1], None)
|
1276 |
-
print(conv.to_openai_api_messages())
|
1277 |
-
|
1278 |
-
print('\n')
|
1279 |
-
|
1280 |
-
print('-- Claude template --')
|
1281 |
-
conv = get_conv_template('claude')
|
1282 |
-
conv.append_message(conv.roles[0], 'Hello!')
|
1283 |
-
conv.append_message(conv.roles[1], 'Hi!')
|
1284 |
-
conv.append_message(conv.roles[0], 'How are you?')
|
1285 |
-
conv.append_message(conv.roles[1], None)
|
1286 |
-
print(conv.get_prompt())
|
|
|
1241 |
stop_str='<|endoftext|>',
|
1242 |
)
|
1243 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|