Update app.py
Browse files4 unmodified lines5678891011128 unmodified lines212223232425262728293031323334333435363738394 unmodified linesfrom torchvision import transformsfrom transformers import AutoModelForImageClassification, AutoTokenizerimport os
from transformers import AutoModelmodel = AutoModel.from_pretrained("rameye/1")
# Define the class labelsclass_labels = {8 unmodified lines}
# Load the model and tokenizer from the Hugging Face model hubmodel_name = "m_64gb.pth"
# model = AutoModelForImageClassification.from_pretrained(model_name)
# tokenizer = AutoTokenizer.from_pretrained(model_name)
# Load model directly
# Load the model with the access token passed as an environment variable# model_name = "your_model_name_in_hugging_face"# model = AutoModelForImageClassification.from_pretrained(model_name)model = AutoModelForImageClassification.from_pretrained(model_name)tokenizer = AutoTokenizer.from_pretrained(model_name)model = AutoModel.from_pretrained("rameye/1")tokenizer = AutoTokenizer.from_pretrained(model)
app.py+6-4