Di Zhang
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -51,9 +51,19 @@ def batch_predict(input_texts):
|
|
51 |
assitant_responses = [item for i,item in enumerate(response_texts)]
|
52 |
return assitant_responses
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
i = 'If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home?'
|
55 |
input_texts = [llama_o1_template(i)]
|
56 |
assitant_responses = batch_predict(input_texts)
|
|
|
57 |
print(assitant_responses)
|
58 |
|
59 |
```
|
|
|
51 |
assitant_responses = [item for i,item in enumerate(response_texts)]
|
52 |
return assitant_responses
|
53 |
|
54 |
+
def format_response(response):
|
55 |
+
response = response.replace('<start_of_father_id>','')
|
56 |
+
response = response.replace('<end_of_father_id><start_of_local_id>','👉')
|
57 |
+
response = response.replace('<end_of_local_id><start_of_thought>',', ')
|
58 |
+
response = response.replace('<end_of_thought><start_of_rating>','')
|
59 |
+
response = response.replace('<end_of_rating>','')
|
60 |
+
response = response.replace('<positive_rating>','👍')
|
61 |
+
response = response.replace('<negative_rating>','👎')
|
62 |
+
|
63 |
i = 'If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home?'
|
64 |
input_texts = [llama_o1_template(i)]
|
65 |
assitant_responses = batch_predict(input_texts)
|
66 |
+
assitant_responses = [format_response(response) for response in assitant_responses]
|
67 |
print(assitant_responses)
|
68 |
|
69 |
```
|