Dorna Llama3 8B Instruct

Persian language model

The Dorna Llama3 8B Instruct model is a highly capable AI designed to process and respond to Persian language inputs. What makes it unique is its ability to efficiently handle a wide range of tasks, from answering complex questions to generating code and engaging in conversations. Built on the Meta Llama 3 Instruct model, Dorna Llama3 8B Instruct has been fine-tuned on Persian data, allowing it to understand and respond accurately to Persian language queries. Its performance is impressive, with human evaluation results showing its strength in various categories, including Boolean questions, code generation, and summarization. Whether you're looking to test its capabilities or integrate it into your applications, Dorna Llama3 8B Instruct is a powerful tool that can help you achieve your goals.

PartAI llama3 Updated a year ago

Table of Contents

Model Overview

The Dorna-Llama3-8B-Instruct model, developed by Part AI, is a powerful tool for natural language processing tasks, specifically designed for Persian language tasks. It’s part of the Dorna model family and is built using the Meta Llama 3 Instruct model.

What makes it special?

  • 8B parameters: This model has a massive 8 billion parameters, making it a powerful tool for a wide range of tasks.
  • Persian language support: Dorna-Llama3-8B-Instruct is specifically trained and fine-tuned on Persian data, making it ideal for tasks that require understanding and generating Persian text.
  • Decoder-only architecture: This model uses a decoder-only architecture, which allows it to generate human-like text based on input prompts.

Capabilities

Capable of generating both text and code, this model outperforms many open-source chat models across common industry benchmarks.

Primary Tasks

This model is designed to assist with tasks such as:

  • Answering questions on various topics
  • Generating code
  • Summarizing long pieces of text
  • Translating text from one language to another
  • And many more!

Strengths

So, how does Dorna-Llama3-8B-Instruct compare to other models? Let’s take a look at some of its strengths:

  • High accuracy: This model has been trained on a large dataset and has achieved high accuracy on various tasks.
  • Fast response time: Dorna-Llama3-8B-Instruct can respond quickly to your queries, making it a great tool for real-time conversations.
  • Support for Persian language: This model is specifically designed to support the Persian language, making it a great resource for those who need assistance with Persian text.

Performance

Dorna-Llama3-8B-Instruct is a powerful AI model that shows impressive performance in various tasks. Let’s take a closer look at its speed, accuracy, and efficiency.

Speed

How fast can Dorna-Llama3-8B-Instruct process information? It’s built using the Meta Llama 3 Instruct model, which is known for its speed and efficiency. With 8B parameters, it can handle large amounts of data quickly and accurately.

Accuracy

But how accurate is Dorna-Llama3-8B-Instruct? Let’s look at some numbers. In human evaluation results, it outperforms other models like Meta-Llama-3-8B-Instruct, ==GPT 3.5 turbo-1106==, and ==Persian Mind== in various tasks such as Boolean Questions, Code Generation, and Summarization.

Limitations

While Dorna-Llama3-8B-Instruct is a powerful tool, it’s not perfect. Let’s take a closer look at some of its limitations.

Evaluation Results

The model was evaluated on various tasks, and the results show that it has some weaknesses. For example, when compared to Meta-Llama-3-8B-Instruct, Dorna-Llama3-8B-Instruct had a lower win rate in categories like Code Generation and Math.

Model PairsParametersWin %Lose %Tie %
Dorna-Llama3-8B-Instruct vs. Meta-Llama-3-8B-Instruct8B36.9417.3945.67

Category-based Evaluation

The model’s performance varied across different categories. For instance, it struggled with Boolean Questions, where it had a win rate of only 25%.

CategoryWin/Lose/Tie %
Boolean Questions0.25/0.25/0.5
Code Generation0.6/0.1/0.3
Math0.8/0.08/0.12

Format

Dorna-Llama3-8B-Instruct uses a decoder-only model architecture, specifically designed for Persian data. It’s built on top of the Meta Llama 3 Instruct model.

Supported Data Formats

This model accepts input in the form of tokenized text sequences, similar to other language models. However, it’s specifically designed to handle Persian text data.

Input Requirements

To use this model, you’ll need to:

  • Pre-process your input text data into tokenized sequences
  • Use the AutoTokenizer class to convert your text data into input IDs
  • Create a messages list with the input IDs and other relevant information (e.g., role, content)
Examples
کاغذ A4 بزرگ تر است یا A5؟ کاغذ A4 بزرگتر است
عمر حسین بن علی چند سال بود؟ حسین بن علی 57 سال عمر کرد
سوال را با توجه به متن زیر به فارسی ترجمه کنید: What are the benefits of drinking water? ممنون که این سوال را پرسیدی. فواید نوشیدن آب عبارتند از: ۱- هیدراته نگه داشتن بدن ۲- کمک به کاهش وزن ۳- بهبود عملکرد مغز ۴- کمک به پاکسازی پوست

Here’s an example code snippet to get you started:

import torch
import transformers
from transformers import AutoTokenizer, AutoModelForCausalLM

# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.bfloat16, device_map="auto")

# Create a sample input message
messages = [
    {"role": "system", "content": "You are a helpful Persian assistant. Please answer questions in the asked language."},
    {"role": "user", "content": "کاغذ A4 بزرگ تر است یا A5؟"}
]

# Convert the input message to input IDs
input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)

# Define the terminator tokens
terminators = [tokenizer.eos_token_id, tokenizer.convert_tokens_to_ids("\"")]

# Generate the output
outputs = model.generate(input_ids, max_new_tokens=256, eos_token_id=terminators, do_sample=True, temperature=0.6, top_p=0.9)

# Print the response
response = outputs[0][input_ids.shape[-1]:]
print(tokenizer.decode(response, skip_special_tokens=True))
Dataloop's AI Development Platform
Build end-to-end workflows

Build end-to-end workflows

Dataloop is a complete AI development stack, allowing you to make data, elements, models and human feedback work together easily.

  • Use one centralized tool for every step of the AI development process.
  • Import data from external blob storage, internal file system storage or public datasets.
  • Connect to external applications using a REST API & a Python SDK.
Save, share, reuse

Save, share, reuse

Every single pipeline can be cloned, edited and reused by other data professionals in the organization. Never build the same thing twice.

  • Use existing, pre-created pipelines for RAG, RLHF, RLAF, Active Learning & more.
  • Deploy multi-modal pipelines with one click across multiple cloud resources.
  • Use versions for your pipelines to make sure the deployed pipeline is the stable one.
Easily manage pipelines

Easily manage pipelines

Spend less time dealing with the logistics of owning multiple data pipelines, and get back to building great AI applications.

  • Easy visualization of the data flow through the pipeline.
  • Identify & troubleshoot issues with clear, node-based error messages.
  • Use scalable AI infrastructure that can grow to support massive amounts of data.