Views
No views yet
| Model Size | Full Model | LoRA Adapter | GGUF (Quantized) |
|---|---|---|---|
| 2.6B | Tucan-2.6B-v1.0 | LoRA | GGUF |
| 9B | Tucan-9B-v1.0 | LoRA | GGUF |
| 27B | Tucan-27B-v1.0 📍 | LoRA | GGUF |
| Model | Function Calling | HellaswagBG | WinograndeBG | ARC-Easy-BG | ARC-Challenge-BG |
|---|---|---|---|---|---|
| Tucan-2.6B-v1.0 🔥 | 0.7875 | 0.5924 | 0.6456 | 0.5657 | 0.3754 |
| Tucan-9B-v1.0 🔥 | 0.8667 | 0.7046 | 0.7151 | 0.7024 | 0.5188 |
| Tucan-27B-v1.0 🔥 | 0.875 | 0.6179 | 0.6275 | 0.6486 | 0.442 |
| BgGPT-Gemma-2-2.6B-IT-v1.0 | 0.5874 | 0.6306 | 0.5821 | 0.5657 | 0.372 |
| BgGPT-Gemma-2-9B-IT-v1.0 | 0.7833 | 0.7057 | 0.719 | 0.7231 | 0.5188 |
| BgGPT-Gemma-2-27B-IT-v1.0 | 0.8667 | 0.62 | 0.6212 | 0.6587 | 0.459 |
pip install -U "transformers[torch]" accelerate bitsandbytes<bos><start_of_turn>user
Ти си полезен AI асистент, който предоставя полезни и точни отговори.
Имаш достъп и можеш да извикаш една или повече функции, за да помогнеш с потребителското запитване. Използвай ги, само ако е необходимо и подходящо.
Когато използваш функция, форматирай извикването ѝ в блок ```tool_call``` на отделен ред, a след това ще получиш резултат от изпълнението в блок ```toll_response```.
## Шаблон за извикване:
```tool_call
{"name": <function-name>, "arguments": <args-json-object>}```
## Налични функции:
[your function definitions here]
## Потребителска заявка:
[your query in Bulgarian]<end_of_turn>
<start_of_turn>modeltool_call blocks with function names and parameters - it doesn't actually execute the functions. Your client application must parse these generated calls, execute the actual functions (API calls, database queries, etc.), and provide the results back to the model in tool_response blocks for the conversation to continue the interperation of the results. A full demo is comming soon.1import torch
2import json
3from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
4
5# Load model
6model_name = "s-emanuilov/Tucan-2.6B-v1.0"
7tokenizer = AutoTokenizer.from_pretrained(model_name)
8model = AutoModelForCausalLM.from_pretrained(
9 model_name,
10 torch_dtype=torch.bfloat16,
11 device_map="auto",
12 attn_implementation="eager" # Required for Gemma models
13)
14
15# Create prompt with system template
16def create_prompt(functions, user_query):
17 system_prompt = """Ти си полезен AI асистент, който предоставя полезни и точни отговори.
18
19Имаш достъп и можеш да извикаш една или повече функции, за да помогнеш с потребителското запитване. Използвай ги, само ако е необходимо и подходящо.
20
21Когато използваш функция, форматирай извикването ѝ в блок ```tool_call``` на отделен ред, a след това ще получиш резултат от изпълнението в блок ```toll_response```.
22
23## Шаблон за извикване:
24```tool_call
25{{"name": <function-name>, "arguments": <args-json-object>}}```
26"""
27
28 functions_text = json.dumps(functions, ensure_ascii=False, indent=2)
29 full_prompt = f"{system_prompt}\n## Налични функции:\n{functions_text}\n\n## Потребителска заявка:\n{user_query}"
30
31 chat = [{"role": "user", "content": full_prompt}]
32 return tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
33
34# Example usage
35functions = [{
36 "name": "create_calendar_event",
37 "description": "Creates a new event in Google Calendar.",
38 "parameters": {
39 "type": "object",
40 "properties": {
41 "title": {"type": "string"},
42 "date": {"type": "string"},
43 "start_time": {"type": "string"},
44 "end_time": {"type": "string"}
45 },
46 "required": ["title", "date", "start_time", "end_time"]
47 }
48}]
49
50query = "Създай събитие 'Годишен преглед' за 8-ми юни 2025 от 14:00 до 14:30."
51
52# Generate response
53prompt = create_prompt(functions, query)
54inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
55
56outputs = model.generate(
57 **inputs,
58 max_new_tokens=2048,
59 temperature=0.1,
60 top_k=25,
61 top_p=1.0,
62 repetition_penalty=1.1,
63 do_sample=True,
64 eos_token_id=[tokenizer.eos_token_id, tokenizer.convert_tokens_to_ids("<end_of_turn>")],
65 pad_token_id=tokenizer.eos_token_id
66)
67
68result = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
69print(result)📄 Full methodology, dataset details, and comprehensive evaluation results coming in the upcoming paper