Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- osyvokon/zno
|
| 4 |
+
- byebyebye/ukr-wiki-qa-v1
|
| 5 |
+
- byebyebye/ukr-wiki-qa-v2
|
| 6 |
+
language:
|
| 7 |
+
- uk
|
| 8 |
+
---
|
| 9 |
+
## Introduction
|
| 10 |
+
kodkobzar13B is a generative model that was trained on Ukrainian Wikipedia data and Ukrainian language rules. It has knowledge of Ukrainian history, language, literature and culture.
|
| 11 |
+
|
| 12 |
+
## Model Information
|
| 13 |
+
This model is based on [vicuna-13b-v1.5](https://huggingface.co/lmsys/vicuna-13b-v1.5).
|
| 14 |
+
|
| 15 |
+
## Model Usage
|
| 16 |
+
|
| 17 |
+
Use the following prompt template: <br>
|
| 18 |
+
USER: {input} ASSISTANT:
|
| 19 |
+
|
| 20 |
+
We recommend using next configurations:
|
| 21 |
+
|
| 22 |
+
<b>Temperature:</b> 0.8 <br>
|
| 23 |
+
<b>Top-p:</b> 0.95
|
| 24 |
+
|
| 25 |
+
### Inference
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
import torch
|
| 29 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 30 |
+
model_path="ponoma16/kodkobzar13B_x2_lit_history_lang_finetuned-merged"
|
| 31 |
+
|
| 32 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 33 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 34 |
+
model_load_path,
|
| 35 |
+
low_cpu_mem_usage=True,
|
| 36 |
+
torch_dtype=torch.float16,
|
| 37 |
+
device_map='auto',
|
| 38 |
+
)
|
| 39 |
+
model.eval()
|
| 40 |
+
|
| 41 |
+
prompt = "Яке місто в Україні називають найромантичнішим?"
|
| 42 |
+
|
| 43 |
+
PROMPT_TEMPLATE = """USER: {prompt} ASSISTANT: """
|
| 44 |
+
|
| 45 |
+
input_ids = tokenizer(
|
| 46 |
+
prompt,
|
| 47 |
+
return_tensors="pt",
|
| 48 |
+
truncation=True,
|
| 49 |
+
).input_ids.cuda()
|
| 50 |
+
outputs = model.generate(
|
| 51 |
+
input_ids=input_ids,
|
| 52 |
+
do_sample=True,
|
| 53 |
+
top_p=0.95,
|
| 54 |
+
max_new_tokens=150,
|
| 55 |
+
temperature=0.8,
|
| 56 |
+
)
|
| 57 |
+
prediction = tokenizer.batch_decode(outputs.cpu().numpy(), skip_special_tokens=True)[0]
|
| 58 |
+
print(prediction)
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
## Contact
|
| 63 |
+
|
| 64 |
+
If you have any inquiries, please feel free to raise an issue or reach out to us via email at: mariiaponomarenko10@gmail.com, benjamin.ye@me.com.
|
| 65 |
+
We're here to assist you!"
|