cnatale commited on
Commit
b389d5f
1 Parent(s): 50015ae

Update README.md

Browse files

Update create_prompt method to reflect new schema.

Files changed (1) hide show
  1. README.md +8 -8
README.md CHANGED
@@ -59,20 +59,20 @@ def create_prompt(sample):
59
 
60
  """
61
  bos_token = "<s>"
62
- original_system_message = "table:"
63
- system_message = "Use the provided input to create an instruction that could have been used to generate the response with an LLM. The query dialect is Athena/Presto. The database table used is: "
64
- question_and_response = sample["text"].replace(original_system_message, "").replace("Q:", "\n\n### Input:\n").replace("A:","\n### Response:\n").strip()
 
65
  eos_token = "</s>"
66
 
67
  full_prompt = ""
68
  full_prompt += bos_token
69
- full_prompt += "### Instruction:"
70
- full_prompt += "\n" + system_message
71
- full_prompt += "\n" + question_and_response
72
- full_prompt += eos_token
73
 
74
  return full_prompt
75
-
76
  ...
77
 
78
  from trl import SFTTrainer
 
59
 
60
  """
61
  bos_token = "<s>"
62
+ original_system_message = "Below is an instruction that describes a task. Write a response that appropriately completes the request."
63
+ system_message = "Write a SQL query or use a function to answer the following question. Use the SQL dialect Presto for AWS Athena."
64
+ question = sample["question"].replace(original_system_message, "").strip()
65
+ response = sample["answer"].strip()
66
  eos_token = "</s>"
67
 
68
  full_prompt = ""
69
  full_prompt += bos_token
70
+ full_prompt += "[INST] " + system_message + "\n\n"
71
+ full_prompt += question + " [/INST] "
72
+ full_prompt += response
73
+ full_prompt += eos_token + "\n"
74
 
75
  return full_prompt
 
76
  ...
77
 
78
  from trl import SFTTrainer