mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-28 03:12:31 +08:00
small fixes
This commit is contained in:
parent
ba3a484c06
commit
387e8d8a4c
@ -1237,7 +1237,7 @@ def mixed_precision_ops(quant_config={}, compute_dtype=torch.bfloat16, full_prec
|
|||||||
input, qdata, self.padding_idx, self.max_norm,
|
input, qdata, self.padding_idx, self.max_norm,
|
||||||
self.norm_type, self.scale_grad_by_freq, self.sparse)
|
self.norm_type, self.scale_grad_by_freq, self.sparse)
|
||||||
uncast_bias_weight(self, qdata, None, offload_stream)
|
uncast_bias_weight(self, qdata, None, offload_stream)
|
||||||
target_dtype = out_dtype if out_dtype is not None else weight.params.orig_dtype
|
target_dtype = out_dtype if out_dtype is not None else weight._params.orig_dtype
|
||||||
x = x.to(dtype=target_dtype)
|
x = x.to(dtype=target_dtype)
|
||||||
if scale is not None and scale != 1.0:
|
if scale is not None and scale != 1.0:
|
||||||
x = x * scale.to(dtype=target_dtype)
|
x = x * scale.to(dtype=target_dtype)
|
||||||
|
|||||||
@ -1073,7 +1073,6 @@ class Gemma4_Tokenizer():
|
|||||||
return np.maximum(np.zeros(1), np.minimum(down_slopes, up_slopes))
|
return np.maximum(np.zeros(1), np.minimum(down_slopes, up_slopes))
|
||||||
|
|
||||||
def tokenize_with_weights(self, text, return_word_ids=False, image=None, audio=None, video=None, llama_template=None, skip_template=True, thinking=False, **kwargs):
|
def tokenize_with_weights(self, text, return_word_ids=False, image=None, audio=None, video=None, llama_template=None, skip_template=True, thinking=False, **kwargs):
|
||||||
self.thinking = thinking
|
|
||||||
|
|
||||||
# Process audio
|
# Process audio
|
||||||
audio_features = []
|
audio_features = []
|
||||||
@ -1131,7 +1130,7 @@ class Gemma4_Tokenizer():
|
|||||||
llama_text = llama_template.format(text)
|
llama_text = llama_template.format(text)
|
||||||
else:
|
else:
|
||||||
# Build template from modalities present
|
# Build template from modalities present
|
||||||
system = "<|turn>system\n<|think|><turn|>\n" if self.thinking else ""
|
system = "<|turn>system\n<|think|><turn|>\n" if thinking else ""
|
||||||
media = ""
|
media = ""
|
||||||
if len(images) > 0:
|
if len(images) > 0:
|
||||||
if is_video:
|
if is_video:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user