teddyyyy123 commited on
Commit
772c941
·
verified ·
1 Parent(s): d1d9687

change back to json format after fixing eval() security issue

Browse files
Files changed (1) hide show
  1. 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
- Answer :[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,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'] = str(
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',