change back to json format after fixing eval() security issue
Browse files- hf2llamastack.py +2 -2
hf2llamastack.py
CHANGED
|
@@ -23,7 +23,7 @@ COT_PROMPT_TEMPATE = textwrap.dedent(
|
|
| 23 |
## Step 2: [Concise description]
|
| 24 |
[Brief explanation]
|
| 25 |
Regardless of the approach, always conclude with:
|
| 26 |
-
|
| 27 |
where the [the_answer_letter] is one of A, B, C or D.
|
| 28 |
Let's think step by step.
|
| 29 |
"""
|
|
@@ -61,7 +61,7 @@ def convert_to_llamastack_format(ds):
|
|
| 61 |
|
| 62 |
# must use the df.loc syntax, directly assigning to row['key'] won't keep it
|
| 63 |
df.loc[idx, 'input_query'] = row['Question']
|
| 64 |
-
df.loc[idx, 'chat_completion_input'] =
|
| 65 |
[{
|
| 66 |
'role':'user', 'content':[{
|
| 67 |
'type':'text',
|
|
|
|
| 23 |
## Step 2: [Concise description]
|
| 24 |
[Brief explanation]
|
| 25 |
Regardless of the approach, always conclude with:
|
| 26 |
+
The best answer is [the_answer_letter].
|
| 27 |
where the [the_answer_letter] is one of A, B, C or D.
|
| 28 |
Let's think step by step.
|
| 29 |
"""
|
|
|
|
| 61 |
|
| 62 |
# must use the df.loc syntax, directly assigning to row['key'] won't keep it
|
| 63 |
df.loc[idx, 'input_query'] = row['Question']
|
| 64 |
+
df.loc[idx, 'chat_completion_input'] = json.dumps(
|
| 65 |
[{
|
| 66 |
'role':'user', 'content':[{
|
| 67 |
'type':'text',
|