Instructions to use ponoma16/CodeKobzar13B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ponoma16/CodeKobzar13B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ponoma16/CodeKobzar13B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ponoma16/CodeKobzar13B") model = AutoModelForCausalLM.from_pretrained("ponoma16/CodeKobzar13B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ponoma16/CodeKobzar13B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ponoma16/CodeKobzar13B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ponoma16/CodeKobzar13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ponoma16/CodeKobzar13B
- SGLang
How to use ponoma16/CodeKobzar13B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ponoma16/CodeKobzar13B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ponoma16/CodeKobzar13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ponoma16/CodeKobzar13B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ponoma16/CodeKobzar13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ponoma16/CodeKobzar13B with Docker Model Runner:
docker model run hf.co/ponoma16/CodeKobzar13B
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!"
|