Downloads · 30 days
25
8% of all-time downloads
sartajbhuvaji/OLMo-1B-Base-shakespeare
OLMo-1B-Base-shakespeare is a text generation model from sartajbhuvaji. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
OLMo-1B-Base-Shakespeare is a fine-tuned version of the allenai/OLMo-1B-0724-hf model, retrained on the complete collection of novels by William Shakespeare. The model aims to generate text in the style of Shakespeare…
Downloads · 30 days
25
8% of all-time downloads
All-time downloads
332
Public
Parameters
1.3B
15.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt10.2 GB · 50%
From the Hugging Face model README
OLMo-1B-Base-Shakespeare is a fine-tuned version of the allenai/OLMo-1B-0724-hf model, retrained on the complete collection of novels by William Shakespeare. The model aims to generate text in the style of Shakespeare's works and has been optimized to capture the linguistic and stylistic nuances present in the original text.
Model Type: Base Model
Base Model: allenai/OLMo-1B-0724-hf
Training Dataset: Works by William Shakespeare
GPU VRAM Requirements: 25 GB
Intended Use Cases:
Ensure you have the transformers library installed:
pip install transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
torch.random.manual_seed(0)
model_name = 'sartajbhuvaji/OLMo-1B-Base-Shakespeare'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
device_map="cuda",
torch_dtype="auto",
trust_remote_code=True,
)
model.to('cuda')
input_text = 'Hello how are you?'
input_ids = tokenizer.encode(input_text, return_tensors='pt').to('cuda')
output = model.generate(input_ids, max_length=100, num_return_sequences=1, no_repeat_ngram_size=2)
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_text)
'''
Hello how are you?
SECOND GENTLEMAN. I am a gentleman.
The Duke, my lord, and all the court are yours.
Enter a MESSENGER
THIRD GENTSLE MAN. Here's a messenger. What news? What's the news,
sir? How doth your lady? Is she well? Or is she
hears'd, beaten, or slain? The news is, sir
'''
