Downloads · 30 days
0
AnLeDinhMinh/formal-converter-v1.3-cot
formal-converter-v1.3-cot is a machine learning model from AnLeDinhMinh. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
Formal Converter v1.3 là một mô hình ngôn ngữ lớn (LLM) được tinh chỉnh (fine-tuned) đặc biệt để chuẩn hóa văn phong giao tiếp của sinh viên Việt Nam.
Downloads · 30 days
0
Access
Public
Updated Dec 23, 2025
Repo size
334 MB
Likes
0
Public
Click a slice to open those files.
.safetensors323 MB · 95%
From the Hugging Face model README
Formal Converter v1.3 là một mô hình ngôn ngữ lớn (LLM) được tinh chỉnh (fine-tuned) đặc biệt để chuẩn hóa văn phong giao tiếp của sinh viên Việt Nam.
Mô hình này giúp chuyển đổi các câu hội thoại tự nhiên, chứa từ lóng (teencode), viết tắt hoặc thiếu chủ ngữ thành văn bản hành chính trang trọng, lịch sự (dùng để gửi email cho giảng viên, phòng đào tạo...).
Điểm nổi bật:
Để mô hình hoạt động tốt nhất, bạn cần sử dụng đúng định dạng prompt sau khi đưa dữ liệu vào:
Dưới đây là ngữ cảnh, mục đích và câu nói gốc. Hãy phân tích (Reasoning) cách chỉnh sửa, sau đó đưa ra câu viết lại (Target) trang trọng.
### Ngữ cảnh:
{Mô tả ngữ cảnh}
### Mục đích:
{Mục đích của câu nói}
### Câu gốc (Input):
{Câu nói cần sửa}
### Phân tích (Reasoning):
## Hướng dẫn sử dụng (Quick Start)
Bạn có thể chạy mô hình ngay lập tức bằng thư viện `unsloth` (nhanh hơn) hoặc `transformers`.
### 1. Cài đặt thư viện
```bash
pip install "unsloth[colab-new] @ git+[https://github.com/unslothai/unsloth.git](https://github.com/unslothai/unsloth.git)"
pip install --no-deps xformers trl peft accelerate bitsandbytes
from unsloth import FastLanguageModel
import torch
# 1. Load Model
model_name = "AnLeDinhMinh/formal-converter-v1.3-cot"
max_seq_length = 2048
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = model_name,
max_seq_length = max_seq_length,
dtype = None,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model) # Tăng tốc độ suy luận gấp 2 lần
# 2. Định nghĩa Prompt Template (Bắt buộc)
alpaca_prompt = """Dưới đây là ngữ cảnh, mục đích và câu nói gốc. Hãy phân tích (Reasoning) cách chỉnh sửa, sau đó đưa ra câu viết lại (Target) trang trọng.
### Ngữ cảnh:
{}
### Mục đích:
{}
### Câu gốc (Input):
{}
### Phân tích (Reasoning):
{}"""
# 3. Nhập dữ liệu cần sửa
context = "Sinh viên thắc mắc về điểm số trên web"
intent = "Hỏi giảng viên xem có nhầm lẫn không"
input_text = "thay oi hinh nhu diem e bi nham hay sao a, e tinh dc 8 ma tren web co 5, thay coi lai giup e vs"
# 4. Chạy mô hình
inputs = tokenizer(
[
alpaca_prompt.format(
context,
intent,
input_text,
"", # Để trống phần này để model tự điền
)
], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 512, use_cache = True)
print(tokenizer.batch_decode(outputs)[0])
# Uploaded model
- **Developed by:** AnLeDinhMinh
- **License:** apache-2.0
- **Finetuned from model :** unsloth/qwen2.5-7b-instruct-bnb-4bit
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)