CoolFace
Modelpublic

mrm8488/bloom-560m-finetuned-sd-prompts

sourceHugging Facebigscience-bloom-rail-1.0updated 4y agoView on Hugging Face
31likes118downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

bloom-560m-finetuned-sd-prompts

This model is a fine-tuned version of bigscience/bloom-560m on the Gustavosta/Stable-Diffusion-Prompts dataset. It achieves the following results on the evaluation set:

  • —Loss: 0.8742

Example of usage

py
import torch
from transformers import BloomTokenizerFast, BloomForCausalLM

device = 'cuda' if torch.cuda.is_available() else 'cpu'
ckpt = 'mrm8488/bloom-560m-finetuned-sd-prompts' 

tokenizer = BloomTokenizerFast.from_pretrained(ckpt)
model = BloomForCausalLM.from_pretrained(ckpt).to(device)

def generate_prompt(text):
    inputs = tokenizer(text, return_tensors='pt')
    input_ids = inputs.input_ids.to(device)
    attention_mask = inputs.attention_mask.to(device)
    output = model.generate(input_ids, attention_mask=attention_mask, repetition_penalty=1.05, max_length=2048, eos_token_id=tokenizer.eos_token_id)

    return tokenizer.decode(output[0], skip_special_tokens=False)
    
text = "<s>Prompt: pikachu dinning in the eiffel tower"

generate_prompt(text)

# Output: <s>Prompt: pikachu dinning in the eiffel tower, intricate, elegant, highly detailed, digital painting, artstation, concept art, smooth, sharp focus, illustration, art by artgerm and greg rutkowski and alphonse mucha</s>

Model description

More information needed

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 5e-05
  • —trainbatchsize: 1
  • —evalbatchsize: 1
  • —seed: 42
  • —gradientaccumulationsteps: 4
  • —totaltrainbatch_size: 4
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: linear
  • —num_epochs: 2
  • —mixedprecisiontraining: Native AMP

Training results

Training LossEpochStepValidation Loss
2.67430.171002.0891
1.89190.332001.7191
1.59070.53001.4454
1.38650.674001.3247
1.24870.835001.2150
1.15651.06001.1031
0.8961.177001.0612
0.83891.338000.9994
0.80711.59000.9530
0.76281.6710000.9206
0.74231.8311000.8883
0.71552.012000.8742

Framework versions

  • —Transformers 4.22.1
  • —Pytorch 1.12.1+cu113
  • —Datasets 2.5.1
  • —Tokenizers 0.12.1