yguooo commited on
Commit
1d0ceb3
1 Parent(s): 831e13d

Upload create_dataset.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. create_dataset.py +11 -3
create_dataset.py CHANGED
@@ -190,7 +190,10 @@ if __name__ == "__main__":
190
  # the `x['summary']` in `vwxyzjn/summarize_from_feedback_tldr_3_filtered`
191
  # DOES NOT HAVE a leading space so we are adding the leading space and
192
  # `<|endoftext|>` token
193
- reference_response = f" {x['summary']}<|endoftext|>"
 
 
 
194
  y = {
195
  **process_query(x, encoder=tokenizer, hparams=args.tldr_params),
196
  "reference_response": reference_response,
@@ -264,9 +267,14 @@ These columns are added by this preprocessing script:
264
  def process_response_data(x):
265
  # the `x['summaries'][0]['text']` in `openai/summarize_from_feedback` `comaprisons`
266
  # DOES HAVE a leading space so we are just adding the `<|endoftext|>` token
 
 
267
  choice = x["choice"]
268
- chosen = f"{x['summaries'][choice]['text']}<|endoftext|>"
269
- rejected = f"{x['summaries'][1 - choice]['text']}<|endoftext|>"
 
 
 
270
 
271
  chosen_policy = x["summaries"][choice]["policy"]
272
  rejected_policy = x["summaries"][1 - choice]["policy"]
 
190
  # the `x['summary']` in `vwxyzjn/summarize_from_feedback_tldr_3_filtered`
191
  # DOES NOT HAVE a leading space so we are adding the leading space and
192
  # `<|endoftext|>` token
193
+
194
+ # '<|endoftext|>' is only the eos token of pythia model.
195
+ # reference_response = f" {x['summary']}<|endoftext|>"
196
+ reference_response = f" {x['summary']}" + tokenizer.eos_token
197
  y = {
198
  **process_query(x, encoder=tokenizer, hparams=args.tldr_params),
199
  "reference_response": reference_response,
 
267
  def process_response_data(x):
268
  # the `x['summaries'][0]['text']` in `openai/summarize_from_feedback` `comaprisons`
269
  # DOES HAVE a leading space so we are just adding the `<|endoftext|>` token
270
+
271
+ # '<|endoftext|>' is only the eos token of pythia model.
272
  choice = x["choice"]
273
+ # chosen = f"{x['summaries'][choice]['text']}<|endoftext|>"
274
+ # rejected = f"{x['summaries'][1 - choice]['text']}<|endoftext|>"
275
+
276
+ chosen = f"{x['summaries'][choice]['text']}" + tokenizer.eos_token
277
+ rejected = f"{x['summaries'][1 - choice]['text']}" + tokenizer.eos_token
278
 
279
  chosen_policy = x["summaries"][choice]["policy"]
280
  rejected_policy = x["summaries"][1 - choice]["policy"]