ndc8
Refactor backend service to support Gemma 3n model and update requirements; remove obsolete test script and add new dependency tests
4b4e9ed
#!/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() | |