model.py is missing
#1
by
grinvolod
- opened
Hi, great work. I wanted to test the model, but model.py
file is missing in the repo. Could you please add it?
Also, just wanted to note that Transformers
auto import not working.
Hi! Thanks for catching that! π
Fixed both issues - just updated the repo with:
- β
Complete
model.py
file - β Native transformers pipeline support
Super easy usage now:
from transformers import pipeline
classifier = pipeline("age-gender-classification", model="abhilash88/age-gender-prediction")
result = classifier("your_image.jpg")
print(f"Age: {result['age']}, Gender: {result['gender']}")
Try it out and let me know if you hit any issues. π
Hi again! With pipeline("image-classification", model="abhilash88/age-gender-prediction", trust_remote_code=True)
i had this issue:
raise ValueError(
ValueError: Unrecognized configuration class <class 'transformers_modules.abhilash88.age-gender-prediction.fe2695a37455d87bcb01a3171b3e2dcf144966a4.model.AgeGenderConfig'> for this kind of AutoModel: TFAutoModelForImageClassification.
Model type should be one of ConvNextConfig, ConvNextV2Config, CvtConfig, Data2VecVisionConfig, DeiTConfig, EfficientFormerConfig, MobileViTConfig, RegNetConfig, ResNetConfig, SegformerConfig, SwiftFormerConfig, SwinConfig, ViTConfig.
Fixed! Please try to use the following code again
from transformers import pipeline
classifier = pipeline("image-classification", model="abhilash88/age-gender-prediction", trust_remote_code=True)
result = classifier("your_image.jpg")
print(f"Age: {result[0]['age']}, Gender: {result[0]['gender']}")
It works fine for me now.