
    h                        S SK JrJr  S SKJr  S SKJr  S SKJr  S SK	J
r
  \ " S S5      5       rS r\" S	5      r\S
:X  a  \
" \5      r\R!                  5       S    r\" SSS9r\R'                  S S\R(                  S9r\R+                  \/ SQ\R,                  \R.                  S.\R(                  S9r\R1                  SSS9r\R2                  (       a6  \R3                  \R4                  5        \R3                  \R4                  SS9  ggg)    )	dataclassfield)Optional)load_dataset)	ModelCard)HfArgumentParserc                       \ rS rSr% Sr\" SS/ SQS.S9r\\S'   \" S	S
/ SQS.S9r	\\S'   \" SSS0S9r
\\S'   \" SSS0S9r\\S'   \" SSS0S9r\\   \S'   Srg)ScriptArguments   a  
Arguments for the script.

Args:
    model_name (`str`, *optional*, defaults to `"gpt-3.5-turbo"`):
        Language model to target. Possible values are:
    aspect (`str`, *optional*, defaults to `"helpfulness"`):
        Aspect to target.
    push_to_hub (`bool`, *optional*, defaults to `False`):
        Whether to push the dataset to the Hugging Face Hub.
    repo_id (`str`, *optional*, defaults to `"trl-lib/ultrafeedback-gpt-3.5-turbo-helpfulness"`):
        Hugging Face repository ID to push the dataset to.
    dataset_num_proc (`int` or `None`, *optional*, defaults to `None`):
        Number of workers to use for dataset processing.
gpt-3.5-turbozLanguage model to target.)z	alpaca-7bbardzfalcon-40b-instructr   zgpt-4zllama-2-13b-chatzllama-2-70b-chatzllama-2-7b-chatzmpt-30b-chatz
pythia-12bstarchatzultralm-13bzultralm-65bz
vicuna-33bzwizardlm-13bzwizardlm-70bzwizardlm-7b)helpchoices)defaultmetadata
model_namehelpfulnesszsAspect to target. Possible values are: 'helpfulness' (default), 'honesty', 'instruction-following', 'truthfulness'.)r   honestyzinstruction-followingtruthfulnessaspectFr   z4Whether to push the dataset to the Hugging Face Hub.push_to_hubz/trl-lib/ultrafeedback-gpt-3.5-turbo-helpfulnessz2Hugging Face repository ID to push the dataset to.repo_idNz0Number of workers to use for dataset processing.dataset_num_proc )__name__
__module____qualname____firstlineno____doc__r   r   str__annotations__r   r   boolr   r   r   int__static_attributes__r       Y/home/james-whalen/.local/lib/python3.13/site-packages/examples/datasets/ultrafeedback.pyr
   r
      s      /
J 2 7Z
FC  PQK  ANOGS  ',LM'hsm r&   r
   c                     SU S   S./nU S   R                  U5      nU S   U   S   nSUS./n[        U S   U   S   U   S	   5      nUS
:  nX6US.$ )Nuserinstruction)rolecontentmodelscompletionsresponse	assistantannotationsRating   )prompt
completionlabel)indexr$   )	exampler   r   r4   model_indexresponse_contentr5   scorer6   s	            r'   to_unpaired_preferencer<   X   s    '-*@ABF(#))*5K}-k::F&3CDEJ&{3MB6J8TUEQJEGGr&   a  
---
tags: [trl]
---

# UltraFeedback GPT-3.5-Turbo Helpfulness Dataset

## Summary

The UltraFeedback GPT-3.5-Turbo Helpfulness dataset contains processed user-assistant interactions filtered for helpfulness, derived from the [openbmb/UltraFeedback](https://huggingface.co/datasets/openbmb/UltraFeedback) dataset. It is designed for fine-tuning and evaluating models in alignment tasks.

## Data Structure

- **Format**: [Conversational](https://huggingface.co/docs/trl/main/dataset_formats#conversational)
- **Type**: [Unpaired preference](https://huggingface.co/docs/trl/main/dataset_formats#unpaired-preference)

Column:
- `"prompt"`: The input question or instruction provided to the model.
- `"completion"`: The model's response to the prompt.
- `"label"`: A binary value indicating whether the response is sufficiently helpful.

## Generation script

The script used to generate this dataset can be found [here](https://github.com/huggingface/trl/blob/main/examples/datasets/ultrafeedback.py).
__main__zopenbmb/UltraFeedbacktrain)splitc                 .    [         R                  U S   ;   $ )Nr-   )script_argsr   )r8   s    r'   <lambda>rB      s    ..'(2CCr&   F)batchednum_proc)sourcer*   r-   r.   correct_answersincorrect_answers)r   r   )remove_columns	fn_kwargsrD   g?*   )	test_sizeseeddataset)	repo_typeN)dataclassesr   r   typingr   datasetsr   huggingface_hubr   transformersr   r
   r<   
model_cardr   parserparse_args_into_dataclassesrA   rM   filterr   mapr   r   train_test_splitr   r   r   r&   r'   <module>rZ      s,   )  ! % ) = = =@H   
4 zo.F446q9K2'BGnnC--  G
 kkq!,!7!7;CUCUV--	  G &&B&?GK//0{22iH ' r&   