Qwen2.5-7B-Ecom-Refiner

1
license:apache-2.0
by
yuriy-magus
Language Model
OTHER
7B params
New
0 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
16GB+ RAM
Mobile
Laptop
Server
Quick Summary

AI model with specialized capabilities.

Device Compatibility

Mobile
4-6GB RAM
Laptop
16GB RAM
Server
GPU
Minimum Recommended
7GB+ RAM

Code Examples

🚀 Quick Start (Inference)pythontransformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

model_id = "Qwen/Qwen2.5-7B-Instruct"
adapter_id = "yuriy-magus/Qwen2.5-7B-Ecom-Refiner"
device = "cuda" if torch.cuda.is_available() else "cpu"

# 1. Load Tokenizer and Base Model
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.float16 if device == "cuda" else torch.float32,
    device_map="auto" if device == "cuda" else None,
    trust_remote_code=True
)

# 2. Load Adapter
model = PeftModel.from_pretrained(model, adapter_id)
model.to(device).eval()

# 3. Prepare Prompt (as used in training)
category = "Личные вещи / Одежда, обувь, аксессуары"
title = "Кеды pataugas"
original_desc = "Кеды фиpмы PATAUGAS. Кеды пoлнocтью кoжaные, пoдoшвa пpoшитa, мoлнии paбoчие. Сocтoяние хopoшее."
prompt = f"""### Instruction:
Отредактируй описание товара для Авито. Будь грамотным, добавь в текст структуру и привлекательность, а также строго придерживайся фактов из исходного текста.

### Context:
Категория: {category}
Товар: {title}

### Original Description:
{original_desc}

### Improved Description:
"""

# 4. Generate
inputs = tokenizer(prompt, return_tensors="pt").to(device)
with torch.no_grad():
    outputs = model.generate(
        **inputs, 
        max_new_tokens=200, 
        temperature=0.7, 
        top_p=0.9,
        do_sample=True,
        pad_token_id=tokenizer.eos_token_id
    )

result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result.split("### Improved Description:")[-1].strip())

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.