Guard cpu fallback in gemma4 template test like the seedvr2 tests

This commit is contained in:
Glary-Bot
2026-08-04 06:23:39 +00:00
parent f075294467
commit 060f74ce15

View File

@@ -1,8 +1,13 @@
"""Gemma4 chat template regression tests."""
import torch
from comfy.cli_args import args
args.cpu = True # importing comfy.model_management probes the torch device at import time
if not torch.cuda.is_available():
args.cpu = True
from comfy.text_encoders.gemma4 import Gemma4_Tokenizer
from comfy.text_encoders.gemma4 import Gemma4_Tokenizer # noqa: E402
PROMPT = "describe a cute anime girl with fennec ears"