czczup commited on
Commit
00f16a5
1 Parent(s): 9983100

Update conversation.py

Browse files
Files changed (1) hide show
  1. conversation.py +0 -43
conversation.py CHANGED
@@ -1211,46 +1211,3 @@ register_conv_template(
1211
  sep2='</s>',
1212
  )
1213
  )
1214
-
1215
-
1216
- if __name__ == '__main__':
1217
- from fastchat.conversation import get_conv_template
1218
-
1219
- print('-- Vicuna template --')
1220
- conv = get_conv_template('vicuna_v1.1')
1221
- conv.append_message(conv.roles[0], 'Hello!')
1222
- conv.append_message(conv.roles[1], 'Hi!')
1223
- conv.append_message(conv.roles[0], 'How are you?')
1224
- conv.append_message(conv.roles[1], None)
1225
- print(conv.get_prompt())
1226
-
1227
- print('\n')
1228
-
1229
- print('-- Llama-2 template --')
1230
- conv = get_conv_template('llama-2')
1231
- conv.set_system_message('You are a helpful, respectful and honest assistant.')
1232
- conv.append_message(conv.roles[0], 'Hello!')
1233
- conv.append_message(conv.roles[1], 'Hi!')
1234
- conv.append_message(conv.roles[0], 'How are you?')
1235
- conv.append_message(conv.roles[1], None)
1236
- print(conv.get_prompt())
1237
-
1238
- print('\n')
1239
-
1240
- print('-- ChatGPT template --')
1241
- conv = get_conv_template('chatgpt')
1242
- conv.append_message(conv.roles[0], 'Hello!')
1243
- conv.append_message(conv.roles[1], 'Hi!')
1244
- conv.append_message(conv.roles[0], 'How are you?')
1245
- conv.append_message(conv.roles[1], None)
1246
- print(conv.to_openai_api_messages())
1247
-
1248
- print('\n')
1249
-
1250
- print('-- Claude template --')
1251
- conv = get_conv_template('claude')
1252
- conv.append_message(conv.roles[0], 'Hello!')
1253
- conv.append_message(conv.roles[1], 'Hi!')
1254
- conv.append_message(conv.roles[0], 'How are you?')
1255
- conv.append_message(conv.roles[1], None)
1256
- print(conv.get_prompt())
 
1211
  sep2='</s>',
1212
  )
1213
  )