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
ComfyUI
Commits
14764aa2
Commit
14764aa2
authored
Jul 22, 2024
by
comfyanonymous
Browse files
Rename LLAMATokenizer to SPieceTokenizer.
parent
b2c995f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
comfy/text_encoders/aura_t5.py
comfy/text_encoders/aura_t5.py
+2
-2
comfy/text_encoders/spiece_tokenizer.py
comfy/text_encoders/spiece_tokenizer.py
+2
-2
No files found.
comfy/text_encoders/aura_t5.py
View file @
14764aa2
from
comfy
import
sd1_clip
from
.
llama
_tokenizer
import
LLAMA
Tokenizer
from
.
spiece
_tokenizer
import
SPiece
Tokenizer
import
comfy.text_encoders.t5
import
os
...
...
@@ -11,7 +11,7 @@ class PT5XlModel(sd1_clip.SDClipModel):
class
PT5XlTokenizer
(
sd1_clip
.
SDTokenizer
):
def
__init__
(
self
,
embedding_directory
=
None
):
tokenizer_path
=
os
.
path
.
join
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
"t5_pile_tokenizer"
),
"tokenizer.model"
)
super
().
__init__
(
tokenizer_path
,
pad_with_end
=
False
,
embedding_size
=
2048
,
embedding_key
=
'pile_t5xl'
,
tokenizer_class
=
LLAMA
Tokenizer
,
has_start_token
=
False
,
pad_to_max_length
=
False
,
max_length
=
99999999
,
min_length
=
256
,
pad_token
=
1
)
super
().
__init__
(
tokenizer_path
,
pad_with_end
=
False
,
embedding_size
=
2048
,
embedding_key
=
'pile_t5xl'
,
tokenizer_class
=
SPiece
Tokenizer
,
has_start_token
=
False
,
pad_to_max_length
=
False
,
max_length
=
99999999
,
min_length
=
256
,
pad_token
=
1
)
class
AuraT5Tokenizer
(
sd1_clip
.
SD1Tokenizer
):
def
__init__
(
self
,
embedding_directory
=
None
):
...
...
comfy/text_encoders/
llama
_tokenizer.py
→
comfy/text_encoders/
spiece
_tokenizer.py
View file @
14764aa2
import
os
class
LLAMA
Tokenizer
:
class
SPiece
Tokenizer
:
@
staticmethod
def
from_pretrained
(
path
):
return
LLAMA
Tokenizer
(
path
)
return
SPiece
Tokenizer
(
path
)
def
__init__
(
self
,
tokenizer_path
):
import
sentencepiece
...
...
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