| from transformers import GPT2Config, AutoConfig | |
| from diffusers import StableDiffusionPipeline | |
| model_name = "somq/fantassified_icons_v2" | |
| # model_name = "updated_model" | |
| # model = AutoModelForSequenceClassification.from_pretrained(model_name) | |
| # print(model) | |
| # config = AutoConfig.from_pretrained(model_name) | |
| # print(config) | |
| model = StableDiffusionPipeline.from_pretrained(model_name) | |
| # image = model("a photograph of an astronaut riding a horse").images[0] | |
| # print(image) | |
| # Load the existing configuration and model | |
| # existing_config = GPT2Config.from_pretrained("your_model_name_or_path") | |
| # existing_model = GPT2ForTextToImage.from_pretrained("your_model_name_or_path") | |
| # Update the configuration as needed | |
| # updated_config = existing_config # Modify as needed | |
| # Save the updated model and configuration | |
| # updated_model_path = "./updated_model" | |
| updated_model_path = "./" | |
| # updated_config.save_pretrained(updated_model_path) | |
| model.save_pretrained(updated_model_path) | |