File size: 1,127 Bytes
4b4e9ed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
#!/usr/bin/env python3
"""
Test script to verify the transformers dependencies are working
"""
def test_imports():
"""Test that all required transformers imports work"""
try:
print("Testing transformers imports...")
from transformers import AutoProcessor, Gemma3nForConditionalGeneration
print("β
Gemma3nForConditionalGeneration import successful")
from transformers import AutoTokenizer, AutoModelForCausalLM
print("β
Standard transformers imports successful")
import torch
print("β
PyTorch import successful")
import sentencepiece
print("β
SentencePiece import successful")
import tiktoken
print("β
TikToken import successful")
import protobuf
print("β
Protobuf import successful")
print("\nπ All imports successful! Ready for Hugging Face Spaces deployment")
return True
except ImportError as e:
print(f"β Import error: {e}")
return False
if __name__ == "__main__":
test_imports()
|