Commit c55abac
Added
# What does this PR do?
Literally just adds the name field to the Message class.
I verified this change by building a new docker container (using the
`Dockerfile` in the repo) and trialing with a `chat_template` that uses
the `name` field.
Here's the previous behavior:
Input messages:
```
{
"messages": [
{"role": "system", "content": "You are a succinct but helpful AI Assistant listening to a chat server. Address everyone by @<username>"},
{"role": "user", "name": "Aaron", "content": "Hello There!"},
{"role": "assistant", "content": " Hello @aaron! How can I assist you today?"},
{"role": "user", "name": "Sally", "content": "Hiya everyone. Is @aaron is this room?"}
],
"model": "meta-llama/Llama-2-7b-chat-hf"
}
```
Response before the modification:
```
Hello @aaron! Yes, you are in the chat room. How can I assist you today? 😊
Hiya everyone! *waves* It's great to see you all here. Is there something on your mind that you'd like to talk about or ask? I'm here to listen and help in any way I can. 🤖
```
Response after my modification:
```
Hello @sally! Yes, @aaron is currently in the chat room. How may I assist you today?
```
Fixes #1558
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [x] Did you read the [contributor
guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the
[forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes?
Here are the
[documentation
guidelines](https://github.com/huggingface/transformers/tree/main/docs),
and
[here are tips on formatting
docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
@Narsil
---------
Co-authored-by: Aaron Mihalik <[email protected]>
Co-authored-by: drbh <[email protected]>name field to OpenAI compatible API Messages (#1563)1 parent cef0553 commit c55abac
2 files changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
| 803 | + | |
803 | 804 | | |
804 | 805 | | |
805 | 806 | | |
806 | 807 | | |
| 808 | + | |
807 | 809 | | |
808 | 810 | | |
809 | 811 | | |
810 | 812 | | |
| 813 | + | |
811 | 814 | | |
812 | 815 | | |
813 | 816 | | |
814 | 817 | | |
| 818 | + | |
815 | 819 | | |
816 | 820 | | |
817 | 821 | | |
| |||
861 | 865 | | |
862 | 866 | | |
863 | 867 | | |
| 868 | + | |
864 | 869 | | |
865 | 870 | | |
866 | 871 | | |
867 | 872 | | |
| 873 | + | |
868 | 874 | | |
869 | 875 | | |
870 | 876 | | |
871 | 877 | | |
| 878 | + | |
872 | 879 | | |
873 | 880 | | |
874 | 881 | | |
875 | 882 | | |
| 883 | + | |
876 | 884 | | |
877 | 885 | | |
878 | 886 | | |
879 | 887 | | |
| 888 | + | |
880 | 889 | | |
881 | 890 | | |
882 | 891 | | |
| |||
931 | 940 | | |
932 | 941 | | |
933 | 942 | | |
| 943 | + | |
934 | 944 | | |
935 | 945 | | |
936 | 946 | | |
937 | 947 | | |
| 948 | + | |
938 | 949 | | |
939 | 950 | | |
940 | 951 | | |
941 | 952 | | |
| 953 | + | |
942 | 954 | | |
943 | 955 | | |
944 | 956 | | |
945 | 957 | | |
| 958 | + | |
946 | 959 | | |
947 | 960 | | |
948 | 961 | | |
| |||
981 | 994 | | |
982 | 995 | | |
983 | 996 | | |
| 997 | + | |
984 | 998 | | |
985 | 999 | | |
986 | 1000 | | |
987 | 1001 | | |
| 1002 | + | |
988 | 1003 | | |
989 | 1004 | | |
990 | 1005 | | |
991 | 1006 | | |
| 1007 | + | |
992 | 1008 | | |
993 | 1009 | | |
994 | 1010 | | |
995 | 1011 | | |
| 1012 | + | |
996 | 1013 | | |
997 | 1014 | | |
998 | 1015 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| 381 | + | |
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
| |||
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
| 457 | + | |
456 | 458 | | |
457 | 459 | | |
458 | 460 | | |
| |||
547 | 549 | | |
548 | 550 | | |
549 | 551 | | |
| 552 | + | |
| 553 | + | |
550 | 554 | | |
551 | 555 | | |
552 | 556 | | |
| |||
0 commit comments