Spaces:
Sleeping
Sleeping
| import torch | |
| from transformers import AutoConfig, AutoModelForCausalLM | |
| def load_brain_map(path_or_repo): | |
| """Universal loader for Brain Map AI v3.0""" | |
| try: | |
| # Attempt to load via Transformers | |
| model = AutoModelForCausalLM.from_pretrained(path_or_repo, trust_remote_code=True) | |
| print("✅ Loaded via Transformers (Safetensors/Bin)") | |
| return model | |
| except Exception as e: | |
| if ".gguf" in path_or_repo.lower() or os.path.exists(path_or_repo): | |
| print("ℹ️ GGUF detected. Use llama.cpp or LM Studio for execution.") | |
| return None | |
| raise e | |