Commit
·
96ba19d
1
Parent(s):
d965b2f
Update README.md
Browse files
README.md
CHANGED
|
@@ -33,7 +33,7 @@ model = AutoModelForCausalLM.from_pretrained('gretelai/text2table').to('cuda', d
|
|
| 33 |
|
| 34 |
model.eval()
|
| 35 |
|
| 36 |
-
INSTRUCTION_KEY = "### Instruction: Given the following prompt, generate a table.
|
| 37 |
RESPONSE_KEY = "### Response:"
|
| 38 |
INTRO_BLURB = "Below is an instruction that describes a task. Write a response that appropriately completes the request."
|
| 39 |
PROMPT_FOR_GENERATION_FORMAT = """{intro}
|
|
@@ -43,12 +43,12 @@ PROMPT_FOR_GENERATION_FORMAT = """{intro}
|
|
| 43 |
""".format(
|
| 44 |
intro=INTRO_BLURB,
|
| 45 |
instruction_key=INSTRUCTION_KEY,
|
| 46 |
-
prompt_to_generate_table="{
|
| 47 |
response_key=RESPONSE_KEY,
|
| 48 |
)
|
| 49 |
|
| 50 |
PROMPT = "Create a dataset with four columns: patient, sex, agegrp, bp_before and bp_after. The patient column is a numerical identifier, sex is the gender of the patient, agegrp is the age group of the patient, bp_before is the blood pressure (in mmHg) before a certain treatment, and bp_after is the blood pressure (in mmHg) after a certain treatment."
|
| 51 |
-
inputs = PROMPT_FOR_GENERATION_FORMAT.format(
|
| 52 |
tokenizer.pad_token = tokenizer.eos_token
|
| 53 |
input = tokenizer(inputs, return_tensors="pt").to('cuda')
|
| 54 |
input_ids = input['input_ids']
|
|
|
|
| 33 |
|
| 34 |
model.eval()
|
| 35 |
|
| 36 |
+
INSTRUCTION_KEY = "### Instruction: Given the following prompt, generate a table."
|
| 37 |
RESPONSE_KEY = "### Response:"
|
| 38 |
INTRO_BLURB = "Below is an instruction that describes a task. Write a response that appropriately completes the request."
|
| 39 |
PROMPT_FOR_GENERATION_FORMAT = """{intro}
|
|
|
|
| 43 |
""".format(
|
| 44 |
intro=INTRO_BLURB,
|
| 45 |
instruction_key=INSTRUCTION_KEY,
|
| 46 |
+
prompt_to_generate_table="{prompt_to_generate_table}",
|
| 47 |
response_key=RESPONSE_KEY,
|
| 48 |
)
|
| 49 |
|
| 50 |
PROMPT = "Create a dataset with four columns: patient, sex, agegrp, bp_before and bp_after. The patient column is a numerical identifier, sex is the gender of the patient, agegrp is the age group of the patient, bp_before is the blood pressure (in mmHg) before a certain treatment, and bp_after is the blood pressure (in mmHg) after a certain treatment."
|
| 51 |
+
inputs = PROMPT_FOR_GENERATION_FORMAT.format(prompt_to_generate_table=PROMPT)
|
| 52 |
tokenizer.pad_token = tokenizer.eos_token
|
| 53 |
input = tokenizer(inputs, return_tensors="pt").to('cuda')
|
| 54 |
input_ids = input['input_ids']
|