Downloads · 30 days
3
11% of all-time downloads
RichardErkhov/Ar4ikov_-_gpt2-650k-stable-diffusion-prompt-generator-4bits
Ar4ikov_-_gpt2-650k-stable-diffusion-prompt-generator-4bits is a machine learning model from RichardErkhov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
3
11% of all-time downloads
All-time downloads
27
Public
Parameters
126M
127 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors127 MB · 97%
How the weights are stored.
U884.9M · 68%
From the Hugging Face model README
Quantization made by Richard Erkhov.
gpt2-650k-stable-diffusion-prompt-generator - bnb 4bits
license: mit datasets:
TODO: Complete me next time
...
from transformers import pipeline
pipe = pipeline('text-generation', model_id='Ar4ikov/gpt2-650k-stable-diffusion-prompt-generator')
def get_valid_prompt(text: str) -> str:
dot_split = text.split('.')[0]
n_split = text.split('\n')[0]
return {
len(dot_split) < len(n_split): dot_split,
len(n_split) > len(dot_split): n_split,
len(n_split) == len(dot_split): dot_split
}[True]
prompt = 'A Tokio town landscape, sunset, by'
valid_prompt = get_valid_prompt(pipe(prompt, max_length=77)[0]['generated_text'])
print(valid_prompt)
# >>> A Tokio town landscape, sunset, by Greg Rutkowski,Artgerm,trending on Behance,light effect,high detail,3d sculpture,golden ratio,dramatic,dramatic background,digital art