Update app.py
Browse files4 unmodified lines5678910118 unmodified lines2021222324252627282930313233343536374 unmodified linesfrom torchvision import transformsfrom transformers import AutoModelForImageClassification, AutoTokenizerimport os# 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 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)4 unmodified lines567891011128 unmodified lines212223242526272829303132333435363738394 unmodified linesfrom torchvision import transformsfrom transformers import AutoModelForImageClassification, AutoTokenizerimport osfrom 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 hub# 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 = AutoModel.from_pretrained("rameye/1")tokenizer = AutoTokenizer.from_pretrained(model)
app.py+6-4