transformers safetensors text-generation-inference multilingual korean persian english llama trl text-generation ko fa en dataset:custom-dataset dataset:multilingual-chat-data dataset:korean-qa dataset:persian-nlp license:apache-2.0 endpoints_compatible region:us
---
base_model: meta-llama-3.1-8b
datasets:
- custom-dataset
- multilingual-chat-data
- korean-qa
- persian-nlp
language:
- ko
- fa
- en
library_name: transformers
license: apache-2.0
pipeline_tag: text-generation
tags:
- text-generation-inference
- transformers
- multilingual
- korean
- persian
- english
- llama
- trl
inference_framework: transformers
model_creator: ISANG AI - Hossein Mohseni
model_type: llama
license_url: https://www.apache.org/licenses/LICENSE-2.0
---

# ISANG-v1.0-8B 🌐

**ISANG-v1.0-8B** is a multilingual large language model designed to understand and generate text in **Korean**, **Persian**, and **English**. Created by **Hossein Mohseni**, this model is tailored for conversational tasks and is optimized for answering questions, storytelling, and assisting with creative and practical tasks in these three languages.

## Model Details

- **Model Type**: Causal Language Model
- **Architecture**: 8 Billion Parameters
- **Languages**: Korean, Persian, English
- **Framework**: [Hugging Face Transformers](https://github.com/huggingface/transformers)
- **Device Compatibility**: Optimized for inference on CPU and GPU (9GB+ VRAM recommended for GPU use).

## Example Use Case

This model is ideal for:
- Multilingual Chatbots
- Translation (Korean/Persian/English)
- Creative Writing
- Language Tutoring and Assistance
- General-purpose Question Answering

## How to Use

To load and use ISANG-v1.0-8B, follow the example code below:

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

# Load the model and tokenizer
model_name = "hosseinhimself/ISANG-v1.0-8B"
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
model = AutoModelForCausalLM.from_pretrained(model_name)

# Prepare a prompt
prompt = "Translate the following sentence to Persian:\n\nHello, how are you?"

# Tokenize the input
inputs = tokenizer(prompt, return_tensors="pt")

# Generate a response
output = model.generate(inputs.input_ids, max_new_tokens=100)
response = tokenizer.decode(output[0], skip_special_tokens=True)

print(response)
```

### Chatbot Example
You can integrate ISANG into a chatbot application using [Gradio](https://gradio.app):

```python
import gradio as gr

def chat(input_text):
    inputs = tokenizer(input_text, return_tensors="pt")
    output = model.generate(inputs.input_ids, max_new_tokens=100)
    response = tokenizer.decode(output[0], skip_special_tokens=True)
    return response

iface = gr.Interface(fn=chat, inputs="text", outputs="text")
iface.launch()
```

## Model Performance

### Supported Languages
| Language | Use Case Examples                | Notes                            |
|----------|----------------------------------|----------------------------------|
| Korean   | Chat, Translation, Summarization | Native-level fluency            |
| Persian  | Chat, Translation, Summarization | Tailored for cultural context   |
| English  | Chat, QA, Summarization          | Strong general-purpose support  |

### Limitations
- **Cultural Nuances**: While ISANG is trained to handle cultural contexts, it may not always capture subtle nuances perfectly.
- **Language Restriction**: Only supports Korean, Persian, and English. Input in other languages may not yield coherent results.

## Hyperparameters

The following parameters can be customized for generation:
- **Max Tokens**: 1–2048 (default: 1024)
- **Temperature**: 0.0–2.0 (default: 0.7)
- **Top-p**: Default: 0.9 (not directly exposed but can be modified in code)
