Commit 0609c4cf authored by Your Name's avatar Your Name

Fix: Remove redundant import os statements causing UnboundLocalError

- Removed redundant 'import os' statements inside functions (lines 4522, 4926, 5005)
- Added back missing 'from llama_cpp import Llama' that was accidentally deleted
- Global 'import os' at line 12 is now the only one

This fixes the UnboundLocalError when running --list-cached-models or other CLI options.
parent 496c4e53
...@@ -4520,7 +4520,6 @@ def main(): ...@@ -4520,7 +4520,6 @@ def main():
print(f"Detected GGUF image model, loading with llama.cpp...") print(f"Detected GGUF image model, loading with llama.cpp...")
try: try:
from llama_cpp import Llama from llama_cpp import Llama
import os
model_key = f"image:{original_model_name}" model_key = f"image:{original_model_name}"
...@@ -4924,7 +4923,7 @@ def main(): ...@@ -4924,7 +4923,7 @@ def main():
print(f"Detected GGUF image model, loading with llama.cpp...") print(f"Detected GGUF image model, loading with llama.cpp...")
try: try:
from llama_cpp import Llama from llama_cpp import Llama
import os from llama_cpp import Llama
model_key = f"image:{original_model_name}" model_key = f"image:{original_model_name}"
...@@ -5003,7 +5002,7 @@ def main(): ...@@ -5003,7 +5002,7 @@ def main():
print(f"Warning: Failed to pre-load GGUF image model: {e}") print(f"Warning: Failed to pre-load GGUF image model: {e}")
try: try:
from llama_cpp import Llama from llama_cpp import Llama
import os from llama_cpp import Llama
model_key = f"image:{model_name}" model_key = f"image:{model_name}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment