Download debug_mro.py from paswans05/Ini-i0.5: direct link, hf CLI and curl.
- Browser
- Download file 710 Bytes
-
https://huggingface.co/paswans05/Ini-i0.5/resolve/main/debug_mro.py
- Command line
-
hf download hf://paswans05/Ini-i0.5/debug_mro.py
-
curl -L -o debug_mro.py https://huggingface.co/paswans05/Ini-i0.5/resolve/main/debug_mro.py
710 Bytes
| from modeling_ini import IniForCausalLM, IniConfig | |
| from transformers import PreTrainedModel | |
| import inspect | |
| def debug_mro(): | |
| print("MRO for IniForCausalLM:") | |
| for cls in IniForCausalLM.mro(): | |
| print(f" - {cls.__name__}") | |
| print("\nChecking for 'generate' in MRO:") | |
| for cls in IniForCausalLM.mro(): | |
| if 'generate' in cls.__dict__: | |
| print(f" - Found 'generate' in {cls.__name__}") | |
| print("\nIs PreTrainedModel in bases?") | |
| print(issubclass(IniForCausalLM, PreTrainedModel)) | |
| print("\nDirect check:") | |
| model = IniForCausalLM(IniConfig()) | |
| print(f"Has generate? {hasattr(model, 'generate')}") | |
| if __name__ == "__main__": | |
| debug_mro() | |