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
xuwx1
LightX2V
Commits
33f0f67f
"examples/cpp/vscode:/vscode.git/clone" did not exist on "4c9959f6b95e20f0a4a0a45c21d168ee7b568dc9"
Unverified
Commit
33f0f67f
authored
Dec 04, 2025
by
Yang Yong (雍洋)
Committed by
GitHub
Dec 04, 2025
Browse files
Fix hunyuan 1.5 get_byt5_text_tokens (#565)
parent
be303ba9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
lightx2v/models/input_encoders/hf/hunyuan15/byt5/model.py
lightx2v/models/input_encoders/hf/hunyuan15/byt5/model.py
+23
-0
No files found.
lightx2v/models/input_encoders/hf/hunyuan15/byt5/model.py
View file @
33f0f67f
...
@@ -257,6 +257,29 @@ class ByT5TextEncoder:
...
@@ -257,6 +257,29 @@ class ByT5TextEncoder:
result
=
list
(
dict
.
fromkeys
(
result
))
if
len
(
result
)
>
1
else
result
result
=
list
(
dict
.
fromkeys
(
result
))
if
len
(
result
)
>
1
else
result
return
result
return
result
def
get_byt5_text_tokens
(
self
,
byt5_tokenizer
,
byt5_max_length
,
text_prompt
):
"""
Tokenize text prompt for byT5 model.
Args:
byt5_tokenizer: The byT5 tokenizer
byt5_max_length: Maximum sequence length
text_prompt: Text prompt to tokenize
Returns:
Tuple of (input_ids, attention_mask)
"""
byt5_text_inputs
=
byt5_tokenizer
(
text_prompt
,
padding
=
"max_length"
,
max_length
=
byt5_max_length
,
truncation
=
True
,
add_special_tokens
=
True
,
return_tensors
=
"pt"
,
)
return
byt5_text_inputs
.
input_ids
,
byt5_text_inputs
.
attention_mask
def
_process_single_byt5_prompt
(
self
,
prompt_text
,
device
):
def
_process_single_byt5_prompt
(
self
,
prompt_text
,
device
):
"""
"""
Process a single prompt for byT5 encoding.
Process a single prompt for byT5 encoding.
...
...
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