Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
f1a1eb4a
Unverified
Commit
f1a1eb4a
authored
Jul 21, 2023
by
Yih-Dar
Committed by
GitHub
Jul 21, 2023
Browse files
Fix `llama` tokenization doctest (#24990)
fix Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
a7d21318
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/llama/tokenization_llama.py
src/transformers/models/llama/tokenization_llama.py
+2
-2
No files found.
src/transformers/models/llama/tokenization_llama.py
View file @
f1a1eb4a
...
@@ -332,7 +332,7 @@ class LlamaTokenizer(PreTrainedTokenizer):
...
@@ -332,7 +332,7 @@ class LlamaTokenizer(PreTrainedTokenizer):
return
output
return
output
def
_build_conversation_input_ids
(
self
,
conversation
:
"Conversation"
)
->
List
[
int
]:
def
_build_conversation_input_ids
(
self
,
conversation
:
"Conversation"
)
->
List
[
int
]:
"""Builds the input ids for a conversation.
r
"""Builds the input ids for a conversation.
This is the format used in the provided examples. System prompts should be manually added at the beginning of
This is the format used in the provided examples. System prompts should be manually added at the beginning of
the conversation. If no system prompt is given, the `DEFAULT_SYSTEM_PROMPT` will be used.
the conversation. If no system prompt is given, the `DEFAULT_SYSTEM_PROMPT` will be used.
```
```
...
@@ -347,7 +347,7 @@ class LlamaTokenizer(PreTrainedTokenizer):
...
@@ -347,7 +347,7 @@ class LlamaTokenizer(PreTrainedTokenizer):
>>> Conversation(
>>> Conversation(
... "<<SYS>>\n Only answer with emojis, and charades\n<</SYS>>\n\nHow can I build a house in 10 septs?"
... "<<SYS>>\n Only answer with emojis, and charades\n<</SYS>>\n\nHow can I build a house in 10 septs?"
... )
... )
# doctest: +IGNORE_RESULT
```
```
Args:
Args:
conversation (`Conversation`):
conversation (`Conversation`):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment