Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add sharegpt multirole #1137

Merged
merged 16 commits into from
Mar 19, 2024
Merged

Feat: Add sharegpt multirole #1137

merged 16 commits into from
Mar 19, 2024

Conversation

NanoCode012
Copy link
Collaborator

@NanoCode012 NanoCode012 commented Jan 17, 2024

See below for update: #1137 (comment)


Description: Allow multiple roles for input and output.

NOTE: Beta and hardcoded values for now!

How to use:

- type: sharegpt
+ type: sharegpt.load_multirole

Only supports conversation: (chatml|zephyr)

Comment on lines 193 to 201
input_roles = {
"human",
"funcresponse",
"funccaller",
"tool",
"tool_response",
user,
}
output_roles = {"gpt", "tool_caller", assistant}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add your new roles here if you want to use names other than these.

Comment on lines 358 to 361
CONVERSATION_ROLE_FORMAT = {
"chatml": "<|im_start|>{ROLE}",
"zephyr": "<|{ROLE}|>",
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to use a role other than chatml, zephyr, add the role format here. This would then use your from: ___ value into the {ROLE} placeholder.

@NanoCode012 NanoCode012 force-pushed the feat/sharegpt_multirole branch from 13f31d8 to 33bcf57 Compare February 22, 2024 13:13
@NanoCode012
Copy link
Collaborator Author

NanoCode012 commented Feb 22, 2024

Rebased! For those using this branch earlier, you will need to delete and repull due to rebase.

Breaking change: We do not need the type: sharegpt.load_multirole anymore!

How to use:

datasets:
  - path:
    type: sharegpt
    conversation: chatml
    roles:
      input: ['human', 'funcresponse', ...]
      output: ['gpt', 'tool_caller', ...]

Same as above, only chatml and zephyr role supported, but it's easy to add more in future!

Edit: Waiting for Pydantic PR to be merged.

@NanoCode012 NanoCode012 marked this pull request as ready for review February 22, 2024 13:16
@xiechengmude
Copy link

Rebased! For those using this branch earlier, you will need to delete and repull due to rebase.

Breaking change: We do not need the type: sharegpt.load_multirole anymore!

How to use:

datasets:
  - path:
    type: sharegpt
    conversation: chatml
    roles:
      input: ['human', 'funcresponse', ...]
      output: ['gpt', 'tool_caller', ...]

Same as above, only chatml and zephyr role supported, but it's easy to add more in future!

Edit: Waiting for Pydantic PR to be merged.

Amazing ! Waiting for the merge processing. Is there any timeline here?

@NanoCode012 NanoCode012 requested a review from winglian March 12, 2024 02:05
@NanoCode012 NanoCode012 merged commit 40a88e8 into main Mar 19, 2024
6 checks passed
seungduk-yanolja pushed a commit to Y-IAB/axolotl that referenced this pull request Mar 19, 2024
* feat(prompt): support multiple roles for sharegpt

* fix: add handling of empty role back

* feat: rebased and allowed more dynamic roles via config

* fix: variable

* chore: update message

* feat: add vicuna format

* fix: JSON serializable error

* fix: typing

* fix: don't remap for unknown keys

* fix: add roles to pydantic

* feat: add test

* chore: remove leftover print

* chore: remove leftover comment

* chore: remove print

* fix: update test to use chatml
djsaunde pushed a commit that referenced this pull request Dec 17, 2024
* feat(prompt): support multiple roles for sharegpt

* fix: add handling of empty role back

* feat: rebased and allowed more dynamic roles via config

* fix: variable

* chore: update message

* feat: add vicuna format

* fix: JSON serializable error

* fix: typing

* fix: don't remap for unknown keys

* fix: add roles to pydantic

* feat: add test

* chore: remove leftover print

* chore: remove leftover comment

* chore: remove print

* fix: update test to use chatml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants