Update README.md
Browse files
README.md
CHANGED
|
@@ -2,8 +2,40 @@
|
|
| 2 |
tags:
|
| 3 |
- model_hub_mixin
|
| 4 |
- pytorch_model_hub_mixin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
|
| 8 |
- Code: [More Information Needed]
|
| 9 |
- Paper: [More Information Needed]
|
|
|
|
| 2 |
tags:
|
| 3 |
- model_hub_mixin
|
| 4 |
- pytorch_model_hub_mixin
|
| 5 |
+
- gpt-like
|
| 6 |
+
- russian
|
| 7 |
+
- jokes
|
| 8 |
+
language:
|
| 9 |
+
- ru
|
| 10 |
+
metrics:
|
| 11 |
+
- perplexity
|
| 12 |
+
model_type: transformer
|
| 13 |
+
library_name: pytorch
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# Russian Jokes GPT-small
|
| 17 |
+
|
| 18 |
+
**“LLM-course HW1”**
|
| 19 |
+
|
| 20 |
+
## Модель
|
| 21 |
+
|
| 22 |
+
Эта модель предназначена для генерации шуток на русском языке. Использует архитектуру трансформера с ALiBi и GQA для позиционного кодирования и внимания.
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
## Использование
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 29 |
+
|
| 30 |
+
model = AutoModelForCausalLM.from_pretrained("your_username/my-ru-joke-small")
|
| 31 |
+
tokenizer = AutoTokenizer.from_pretrained("your_username/my-ru-joke-small")
|
| 32 |
+
|
| 33 |
+
prompt = "Встретились два экономиста,"
|
| 34 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
|
| 35 |
+
generated_ids = model.generate(input_ids, max_new_tokens=40, temperature=0.9, top_k=40)
|
| 36 |
+
|
| 37 |
+
print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))
|
| 38 |
+
|
| 39 |
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
|
| 40 |
- Code: [More Information Needed]
|
| 41 |
- Paper: [More Information Needed]
|