Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,95 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
|
5 |
+
# haijian06/Yi-1.5-6B-Chat-Agent_sft
|
6 |
+
|
7 |
+
## Overview
|
8 |
+
|
9 |
+
The `haijian06/Yi-1.5-6B-Chat-Agent_sft` model is an advanced conversational agent built upon the Yi-1.5-6B-Chat model. This model has been fine-tuned to enhance its capabilities in handling agent tasks and function calls, making it a versatile tool for a variety of applications.
|
10 |
+
|
11 |
+
## Features
|
12 |
+
|
13 |
+
- **Improved Conversational Abilities**: Enhanced dialogue management and natural language understanding.
|
14 |
+
- **Function Call Capability**: Supports complex function call operations, making it suitable for automation and task handling.
|
15 |
+
- **High Performance**: Optimized for speed and accuracy in responses.
|
16 |
+
|
17 |
+
## Installation
|
18 |
+
|
19 |
+
To use this model, you need to have Python and the necessary libraries installed. You can install the required dependencies using the following commands:
|
20 |
+
|
21 |
+
```bash
|
22 |
+
pip install torch transformers
|
23 |
+
```
|
24 |
+
|
25 |
+
## Usage
|
26 |
+
|
27 |
+
Here is a basic example of how to use the `haijian06/Yi-1.5-6B-Chat-Agent_sft` model:
|
28 |
+
|
29 |
+
```python
|
30 |
+
import torch
|
31 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
32 |
+
|
33 |
+
# Load the model and tokenizer
|
34 |
+
model_name = "haijian06/Yi-1.5-6B-Chat-Agent_sft"
|
35 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
36 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
37 |
+
|
38 |
+
# Generate a response
|
39 |
+
input_text = "Hello, how can I assist you today?"
|
40 |
+
input_ids = tokenizer.encode(input_text, return_tensors='pt')
|
41 |
+
|
42 |
+
with torch.no_grad():
|
43 |
+
output = model.generate(input_ids, max_length=50)
|
44 |
+
|
45 |
+
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
46 |
+
print(response)
|
47 |
+
```
|
48 |
+
|
49 |
+
## Fine-Tuning
|
50 |
+
|
51 |
+
To fine-tune this model on your own dataset, follow these steps:
|
52 |
+
|
53 |
+
1. Prepare your dataset in a suitable format.
|
54 |
+
2. Use the `Trainer` class from the `transformers` library for training.
|
55 |
+
|
56 |
+
Example training script:
|
57 |
+
|
58 |
+
```python
|
59 |
+
from transformers import Trainer, TrainingArguments
|
60 |
+
|
61 |
+
training_args = TrainingArguments(
|
62 |
+
output_dir='./results',
|
63 |
+
num_train_epochs=3,
|
64 |
+
per_device_train_batch_size=4,
|
65 |
+
per_device_eval_batch_size=4,
|
66 |
+
warmup_steps=500,
|
67 |
+
weight_decay=0.01,
|
68 |
+
logging_dir='./logs',
|
69 |
+
)
|
70 |
+
|
71 |
+
trainer = Trainer(
|
72 |
+
model=model,
|
73 |
+
args=training_args,
|
74 |
+
train_dataset=train_dataset,
|
75 |
+
eval_dataset=eval_dataset
|
76 |
+
)
|
77 |
+
|
78 |
+
trainer.train()
|
79 |
+
```
|
80 |
+
|
81 |
+
## Contributing
|
82 |
+
|
83 |
+
Contributions are welcome! Please fork this repository and submit a pull request with your improvements.
|
84 |
+
|
85 |
+
## License
|
86 |
+
|
87 |
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
88 |
+
|
89 |
+
## Acknowledgements
|
90 |
+
|
91 |
+
This model is built upon the Yi-1.5-6B-Chat model. Special thanks to the developers and contributors of the original model.
|
92 |
+
|
93 |
+
---
|
94 |
+
|
95 |
+
For more information, please visit our [GitHub repository](https://github.com/haijian06/Yi-1.5-6B-Chat-Agent_sft).
|