Spaces:
Running
on
Zero
Running
on
Zero
Update extras/expansion.py
Browse files- extras/expansion.py +1 -1
extras/expansion.py
CHANGED
@@ -109,7 +109,7 @@ class FooocusExpansion:
|
|
109 |
tokenized_kwargs.data['attention_mask'] = tokenized_kwargs.data['attention_mask'].to(self.patcher.load_device)
|
110 |
|
111 |
current_token_length = int(tokenized_kwargs.data['input_ids'].shape[1])
|
112 |
-
max_token_length =
|
113 |
max_new_tokens = max_token_length - current_token_length
|
114 |
|
115 |
if max_new_tokens == 0:
|
|
|
109 |
tokenized_kwargs.data['attention_mask'] = tokenized_kwargs.data['attention_mask'].to(self.patcher.load_device)
|
110 |
|
111 |
current_token_length = int(tokenized_kwargs.data['input_ids'].shape[1])
|
112 |
+
max_token_length = 255 * int(math.ceil(float(current_token_length) / 255.0))
|
113 |
max_new_tokens = max_token_length - current_token_length
|
114 |
|
115 |
if max_new_tokens == 0:
|