llama vision inference fix (#3270)

* llama vision inference fix

* fix via can_compile_fullgraph instead
This commit is contained in:
DoubleMathew 2025-09-04 18:06:49 -05:00 committed by GitHub
commit b6bd9dc867

View file

@ -206,7 +206,7 @@ def unsloth_base_fast_generate(
# Fix generation_config
# Use hybrid if sliding window seen, otherwise try static
cache_implementation = getattr(self.config, "cache_implementation", None)
if getattr(self, "_supports_static_cache", True):
if getattr(self, "_supports_static_cache", getattr(self, "_can_compile_fullgraph", True)):
if os.environ.get("UNSLOTH_DISABLE_STATIC_GENERATION", "0") == "0":
cache_implementation = "static"
else: