Downloads · 30 days
15
31% of all-time downloads
bikmish/llm-course-hw1
llm-course-hw1 is a text generation model from bikmish. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
A model for generating Russian jokes based on a modified Transformer architecture.
Downloads · 30 days
15
31% of all-time downloads
All-time downloads
49
Public
Parameters
79.7M
318 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors318 MB · 100%
How the weights are stored.
F3279.5M · 100%
From the Hugging Face model README
A model for generating Russian jokes based on a modified Transformer architecture.
REPO_NAME = 'bikmish/llm-course-hw1'
device = torch.device("cuda")
tokenizer = ByteLevelBPETokenizer.from_pretrained(REPO_NAME)
check_model = TransformerForCausalLM.from_pretrained(REPO_NAME)
check_model = check_model.to(device)
check_model = check_model.eval()
text = "Штирлиц пришел домой"
input_ids = torch.tensor(tokenizer.encode(text), device=device)
model_output = check_model.generate(
input_ids[None, :], max_new_tokens=200, eos_token_id=tokenizer.eos_token_id, do_sample=True, top_k=10
)
tokenizer.decode(model_output[0].tolist())
Штирлиц пришел домой с работы, приехал.
Преподаватель к себе и вижу: - Давай зайдем сегодня на работу!
- А как ты думаешь, что мы тебя не пьем?
- Дык нет.
- А ты что, тогда находишься?
- А ты не знаешь - кто?
- Дверь откроется!