初始化项目,由ModelHub XC社区提供模型
Model: vivekmdrift/maya-qwen-7b Source: Original Platform
This commit is contained in:
42
README.md
Normal file
42
README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
base_model: Qwen/Qwen2.5-7B-Instruct
|
||||
tags:
|
||||
- fine-tuned
|
||||
- qwen2.5
|
||||
- customer-support
|
||||
- unsloth
|
||||
- lora
|
||||
pipeline_tag: text-generation
|
||||
---
|
||||
|
||||
# maya-qwen-7b
|
||||
|
||||
Fine-tuned version of [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct)
|
||||
for customer support conversations.
|
||||
|
||||
## Training Details
|
||||
|
||||
- **Method**: LoRA fine-tuning with Unsloth + TRL SFTTrainer
|
||||
- **Base model**: Qwen/Qwen2.5-7B-Instruct
|
||||
- **LoRA rank**: 16
|
||||
- **Format**: ChatML
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained("vivekmdrift/maya-qwen-7b")
|
||||
tokenizer = AutoTokenizer.from_pretrained("vivekmdrift/maya-qwen-7b")
|
||||
|
||||
messages = [
|
||||
{"role": "system", "content": "You are a helpful customer support agent."},
|
||||
{"role": "user", "content": "How can I track my order?"},
|
||||
]
|
||||
|
||||
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
||||
inputs = tokenizer(text, return_tensors="pt")
|
||||
outputs = model.generate(**inputs, max_new_tokens=256)
|
||||
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
||||
```
|
||||
Reference in New Issue
Block a user