Text Generation
Transformers
Safetensors
Serbian
qwen3_5
image-text-to-text
srpski
generativni
model
qa
summarization
translation
reasoning
conversational
Instructions to use procesaur/Orao2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use procesaur/Orao2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="procesaur/Orao2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("procesaur/Orao2") model = AutoModelForMultimodalLM.from_pretrained("procesaur/Orao2", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use procesaur/Orao2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "procesaur/Orao2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "procesaur/Orao2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/procesaur/Orao2
- SGLang
How to use procesaur/Orao2 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 "procesaur/Orao2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "procesaur/Orao2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "procesaur/Orao2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "procesaur/Orao2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use procesaur/Orao2 with Docker Model Runner:
docker model run hf.co/procesaur/Orao2
|
Download README.md from procesaur/Orao2: direct link, hf CLI and curl.
- Browser
- Download file 12.1 kB
-
https://huggingface.co/procesaur/Orao2/resolve/main/README.md
- Command line
-
hf download hf://procesaur/Orao2/README.md
-
curl -L -o README.md https://huggingface.co/procesaur/Orao2/resolve/main/README.md
12.1 kB
| license: cc-by-sa-4.0 | |
| datasets: | |
| - HuggingFaceH4/ultrachat_200k | |
| - OpenDataArena/ODA-Mixture-100k | |
| - te-sla/sft | |
| language: | |
| - sr | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| tags: | |
| - srpski | |
| - generativni | |
| - model | |
| - qa | |
| - summarization | |
| - translation | |
| - reasoning | |
| base_model: | |
| - procesaur/Orao2-GPT | |
| <img src="slicice/orao-cover.svg" class="cover"> | |
| # Orao2 | |
| - Virtualni **AI asistent** za **srpski jezik**, **9 milijardi parametara**. | |
| - Prošireni vokabular tokenizatora za sprski jezik (novih 50.000 tokena) omogućava **30% brže** obučavanje i inferenciju, kao i bolje poravnanje modela sa našim jezikom. | |
| - **[SRNA tokenizator]**(https://huggingface.co/procesaur/Srna_tokenizer), sa podrškom za automatsko preslovljavanje, omogućava modelu **ujednačeniju upotrebu ćirilice i latinice**, koja se sada obrađuju u istom vektorskom prostoru. | |
| - Razmišlja, čita, piše, sažima, analizira zadati tekst i odgovara na pitanja. | |
| - Zasnovan na **Orao2-GPT** modelu i **Qwen3.5** arhitekturi. | |
| - Obučavan na eksperimentalnom SFT skupu. | |
| ## Primeri upotrebe | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| model_id = "procesaur/Orao2" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True) | |
| model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto") | |
| def chat(messages, thinking=true): | |
| inputs = tokenizer.apply_chat_template( | |
| messages, | |
| add_generation_prompt=True, | |
| enable_thinking=thinking, | |
| tokenize=True, | |
| return_dict=True, | |
| return_tensors="pt", | |
| ).to(model.device) | |
| outputs = model.generate(**inputs, max_new_tokens=512) | |
| decoded = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]) | |
| print(decoded.split("</think>")[-1].split("<|im_end|>")[0]) | |
| ``` | |
| ### Odgovaranje na pitanja | |
| ```python | |
| messages = [ | |
| {"role": "system", "content": "Ти си АИ асистент који одговара на природном српском језику, у скаладу са српском културном традицијом."}, | |
| {"role": "user", "content": "Ког датума славимо Никољдан?"}, | |
| ] | |
| chat(messages) | |
| ``` | |
| ```python | |
| Никољдан се слави 19. децембра. | |
| ``` | |
| ```python | |
| messages = [ | |
| {"role": "system", "content": "Ти си АИ асистент који одговара на природном српском језику, у скаладу са српском културном традицијом."}, | |
| {"role": "user", "content": "Ког датума славимо Никољдан? Одговори на латиници."}, | |
| ] | |
| chat(messages) | |
| ``` | |
| ```python | |
| 19. decembar. | |
| ``` | |
| ### Generisanje vektorskih slika | |
| ```python | |
| prompt = ( | |
| "Нацртај сцену према следећем опису на српском језику тако што ћеш вратити само валидан " | |
| "<svg viewBox=\"0 0 1024 512\" width=\"1024\" height=\"512\" xmlns=\"http://www.w3.org/2000/svg\"> " | |
| "елемент без додатног текста или markdown блокова:\n" | |
| "Опис: Застава Републике Србије, у три боје, према званично дефинисаним RGB ознакама. У свакој траци пише име планине у три различита, смешна фонта, различитих величина. Слова имају разнобојни аутлајн." | |
| ) | |
| messages = [ | |
| {"role": "system", "content": "Ti si AI asistent koji pomaže u pisanju koda. Analiziraj zahtev jedan po jedan i napiši kod koji odgovara svim elementima zahteva."}, | |
| {"role": "user", "content": prompt}, | |
| ] | |
| chat(messages, thinking=True) | |
| ``` | |
| <img src="slicice/img_gen.svg"> | |
| ### Generisanje programskog koda | |
| ```python | |
| messages = [ | |
| {"role": "system", "content": "Ti si AI asistent koji pomaže u pisanju koda. Analiziraj zahtev jedan po jedan i napiši kod koji odgovara svim elementima zahteva."}, | |
| {"role": "user", "content": "Napiši mi Pajton funkciju koja očitava word (docx) fajl izvlači iz njega tekst, preslovljava ga u latinicu iz ćirilice i čuva kao txt"}, | |
| ] | |
| chat(messages, thinking=False) | |
| ``` | |
| ```python | |
| import os | |
| from docx import Document | |
| from unidecode import unidecode | |
| def read_docx_to_txt(input_file_path, output_file_path): | |
| if not os.path.exists(input_file_path): | |
| raise FileNotFoundError(f"File not found: {input_file_path}") | |
| doc = Document(input_file_path) | |
| text = "" | |
| for paragraph in doc.paragraphs: | |
| text += paragraph.text + "\n" | |
| latin_text = unidecode(text) | |
| with open(output_file_path, "w", encoding="utf-8") as output_file: | |
| output_file.write(latin_text) | |
| print(f"Text saved to {output_file_path}") | |
| ``` | |
| **Primer korišćenja:** | |
| ```python | |
| read_docx_to_txt("example.docx", "output.txt") | |
| ``` | |
| **Objašnjenje:** | |
| - `os.path.exists()` proverava da li fajl postoji pre čitanja. | |
| - `Document()` čita DOCX fajl i vraća objekat dokumenta. | |
| - `paragraph.text` izvlači tekst iz svakog paragrafa i dodaje ga u string. | |
| - `unidecode()` preslovljava tekst iz ćirilice u latinicu. | |
| - `open()` otvara fajl za pisanje sa UTF-8 enkodiranjem. | |
| - `write()` zapisuje latinizirani tekst u fajl. | |
| - `print()` obaveštava korisnika o uspehu operacije. | |
| ### OCR | |
| <img src="slicice/iskra3.jpg"> | |
| ```python | |
| --- OCR --- | |
| РУЂЕР JOSIF BOŠKOVIĆ | |
| 1711—1787 | |
| I | |
| Nezavisna dubrovačka republika bila je u zgodnim i srećim okolnostima za slobodno razvijanje i napredovanje, te pored Dubrovnika, kao najvažnijeg trgovačkog grada u primorju, beše više centara ne samo trgovačkih nego i književnih iz kojih ponike čitav niz znatnih i velikih radnika. Naslojeni s jedne strane na kulturnog suseda, a s druge dosta izolovani od varvarskih gospodara, kojima ostale srpske zemlje behu izložene, oni su se i mogli uzdići do onoga savršenstva i prefinjenosti u literaturi, | |
| ``` | |
| <div class="inline-flex flex-col avatar-cont"> | |
| <div class="avatar-title">Autor</div> | |
| <a href="https://huggingface.co/procesaur"> | |
| <div class="flex"> | |
| <div class="avatar-cover" | |
| style="background-image: url('https://cdn-uploads.huggingface.co/production/uploads/1673534533167-63bc254fb8c61b8aa496a39b.jpeg?w=200&h=200&f=face')"> | |
| </div> | |
| </div> | |
| <div class="avatar-name">Mihailo Škorić</div> | |
| <div class="avatar-handle">@procesaur</div> | |
| </a> | |
| </div> | |
| <div class="inline-flex flex-col avatar-cont"> | |
| <div class="avatar-title">Računarski resursi</div> | |
| <a href="https://tesla.rgf.bg.ac.rs"> | |
| <div class="flex"> | |
| <div class="avatar-cover" | |
| style="background-image: url(https://www.ai.gov.rs/img/logo_60x120-2.png)"> | |
| </div> | |
| </div> | |
| <div class="avatar-name">Nacionalna AI platforma</div> | |
| <div class="avatar-handle">ai.gov.rs</div> | |
| </a> | |
| </div> | |
| <div class="inline-flex flex-col avatar-cont"> | |
| <div class="avatar-title">Finansiranje</div> | |
| <a href="https://fondzanauku.gov.rs/"> | |
| <div class="flex"> | |
| <div class="avatar-cover" | |
| style="background-image: url(https://fondzanauku.gov.rs/wp-content/uploads/2019/04/FZN-logo-primary-light-1170x396.png)"> | |
| </div> | |
| </div> | |
| <div class="avatar-name">Fond za Nauku</div> | |
| <div class="avatar-handle">@fondzanauku_rs</div> | |
| </a> | |
| </div> | |
| <div class="inline-flex flex-col avatar-cont"> | |
| <div class="avatar-title">Projekat</div> | |
| <a href="https://tesla.rgf.bg.ac.rs/"> | |
| <div class="flex"> | |
| <div class="avatar-cover" | |
| style="background-image: url(https://cdn-avatars.huggingface.co/v1/production/uploads/63bc254fb8c61b8aa496a39b/TfM_-sc8-b34ddfhHBGTA.png)"> | |
| </div> | |
| </div> | |
| <div class="avatar-name">TESLA</div> | |
| <div class="avatar-handle">@te-sla</div> | |
| </a> | |
| </div> | |
| ## Data | |
| <div style="zoom: 0.75;"> | |
| <div class="inline-flex flex-col avatar-cont"> | |
| <a href="https://huggingface.co/procesaur"> | |
| <div class="flex"> | |
| <div class="avatar-cover" | |
| style="background-image: url('https://cdn-uploads.huggingface.co/production/uploads/1673534533167-63bc254fb8c61b8aa496a39b.jpeg?w=200&h=200&f=face')"> | |
| </div> | |
| </div> | |
| </a> | |
| </div> | |
| <div class="inline-flex flex-col avatar-cont"> | |
| <a href="https://huggingface.co/rankas"> | |
| <div class="flex"> | |
| <div class="avatar-cover" | |
| style="background-image: url(https://cdn-avatars.huggingface.co/v1/production/uploads/63f8fa204ef4aacb65a00043/IlrBetI15qnGsc798R6tO.jpeg)"> | |
| </div> | |
| </div> | |
| </a> | |
| </div> | |
| <div class="inline-flex flex-col avatar-cont"> | |
| <a href="https://huggingface.co/te-sla"> | |
| <div class="flex"> | |
| <div class="avatar-cover" | |
| style="background-image: url(https://cdn-avatars.huggingface.co/v1/production/uploads/63bc254fb8c61b8aa496a39b/TfM_-sc8-b34ddfhHBGTA.png)"> | |
| </div> | |
| </div> | |
| </a> | |
| </div> | |
| <div class="inline-flex flex-col avatar-cont"> | |
| <a href="https://huggingface.co/HuggingFaceH4"> | |
| <div class="flex"> | |
| <div class="avatar-cover" | |
| style="background-image: url(https://cdn-avatars.huggingface.co/v1/production/uploads/5f0c746619cb630495b814fd/j26aNEdiOgptZxJ6akGCC.png)"> | |
| </div> | |
| </div> | |
| </a> | |
| </div> | |
| <div class="inline-flex flex-col avatar-cont"> | |
| <a href="https://huggingface.co/OpenDataArena"> | |
| <div class="flex"> | |
| <div class="avatar-cover" | |
| style="background-image: url(https://cdn-avatars.huggingface.co/v1/production/uploads/643e60d96db6ba8c5ee177ad/y-K9JVRETLV0zr_jJYdu3.png)"> | |
| </div> | |
| </div> | |
| </a> | |
| </div> | |
| ## Cit. | |
| ```bibtex | |
| ``` | |
| <br/> | |
| <div id="zastava"> | |
| <div class="grb"> | |
| <img src="https://www.ai.gov.rs/img/logo_60x120-2.png" style="position:relative; left:30px; z-index:10; height:85px"> | |
| </div> | |
| <table width=100% style="border:0px"> | |
| <tr style="background-color:#C6363C;width:100%;border:0px;height:30px"><td style="width:100vw"></td></tr> | |
| <tr style="background-color:#0C4076;width:100%;border:0px;height:30px"><td></td></tr> | |
| <tr style="background-color:#ffffff;width:100%;border:0px;height:30px"><td></td></tr> | |
| </table> | |
| </div> | |
| <table style="width:100%;height:100%"> | |
| <tr style="width:100%;height:100%"> | |
| <td width=50%> | |
| <p>Истраживање jе спроведено уз подршку Фонда за науку Републике Србиjе, #7276, Text Embeddings – Serbian Language Applications – TESLA</p> | |
| </td> | |
| <td> | |
| <p>This research was supported by the Science Fund of the Republic of Serbia, #7276, Text Embeddings - Serbian Language Applications - TESLA</p> | |
| </td> | |
| </tr> | |
| </table> | |
| <style> | |
| .ffeat: { | |
| color:red | |
| } | |
| .cover { | |
| width: 100%; | |
| margin-bottom: 5pt | |
| } | |
| .highlight-container, .highlight { | |
| position: relative; | |
| text-decoration:none | |
| } | |
| .highlight-container { | |
| display: inline-block; | |
| } | |
| .avatar-cont { | |
| line-height: 1.5; | |
| padding-right:50px; | |
| } | |
| .avatar-title{ | |
| text-align: center; | |
| margin-top: 3px; | |
| font-size: 16px; | |
| font-weight: 800; | |
| } | |
| .avatar-name{ | |
| text-align: center; | |
| font-size: 16px; | |
| font-weight: 800; | |
| } | |
| .avatar-handle{ | |
| text-align: center; | |
| font-size: 14px; | |
| } | |
| .avatar-cover{ | |
| display:DISPLAY_1; | |
| margin-left: auto; | |
| margin-right: auto; | |
| width: 92px; | |
| height:92px; | |
| border-radius: 50%; | |
| background-position: center; | |
| background-size: contain; | |
| background-repeat: no-repeat; | |
| } | |
| .highlight{ | |
| color:white; | |
| text-transform:uppercase; | |
| font-size: 16pt; | |
| } | |
| .highlight-container{ | |
| padding:5px 10px | |
| } | |
| .highlight-container:before { | |
| content: " "; | |
| display: block; | |
| height: 100%; | |
| width: 100%; | |
| margin-left: 0px; | |
| margin-right: 0px; | |
| position: absolute; | |
| background: #e80909; | |
| transform: rotate(2deg); | |
| top: -1px; | |
| left: -1px; | |
| border-radius: 20% 25% 20% 24%; | |
| padding: 10px 18px 18px 10px; | |
| } | |
| div.grb, #zastava>table { | |
| position:absolute; | |
| top:0px; | |
| left: 0px; | |
| margin:0px | |
| } | |
| div.grb>img, #zastava>table{ | |
| margin:0px | |
| } | |
| #zastava { | |
| position: relative; | |
| margin-bottom:120px | |
| } | |
| p { | |
| font-size:14pt | |
| } | |
| </style> |