Downloads · 30 days
40
3% of all-time downloads
sign/WeLT-string-repetition
WeLT-string-repetition is a text generation model from sign. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
40
3% of all-time downloads
All-time downloads
1.5K
Public
Parameters
6.9M
165 MB on disk
Likes
0
Public
Click a slice to open those files.
.pt27.6 MB · 66%
From the Hugging Face model README
This model is traained using this config. It is designed to take in English strings, and repeat them.
It is published here, so that it can be used in tests.
from pathlib import Path
import torch
from transformers import GenerationConfig
from transformers.trainer_utils import get_last_checkpoint
from welt.model import WordLatentTransformerForCausalLM
from welt.processor import TextImageProcessor
with torch.no_grad():
model = WordLatentTransformerForCausalLM.from_pretrained("sign/WeLT-string-repetition")
processor = TextImageProcessor.from_pretrained(model_path)
model.eval()
texts = [
# Texts from validation set
"<text>\x0EWouldn't it be more cruel for society to let people die... - ... when with some effort it could save them?\x0F<repeat> ",
"<text>\x0ESuperman's exact opposite who lives in the backwards Bizarro World.\x0F<repeat> ",
"<text>\x0EYOu dOn't know the half Of it.\x0F<repeat> ",
]
inputs = processor(texts, collated=True, packed=False)
outputs = model.generate(
**inputs,
processor=processor,
max_generated_words=32,
)
for text, output in zip(texts, outputs, strict=False):
print(f"Generated for '{text}': {output}")