Add comprehensive README
Browse files
README.md
CHANGED
@@ -1,58 +1,100 @@
|
|
1 |
---
|
2 |
-
base_model: openai/gpt-oss-20b
|
3 |
-
library_name: transformers
|
4 |
-
model_name: fine_tuned
|
5 |
tags:
|
6 |
-
-
|
7 |
-
-
|
8 |
-
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
---
|
11 |
|
12 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
|
15 |
-
It has been trained using [TRL](https://github.com/huggingface/trl).
|
16 |
|
17 |
-
|
18 |
|
19 |
```python
|
20 |
-
from transformers import
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
```
|
27 |
|
28 |
-
|
|
|
|
|
29 |
|
30 |
-
|
|
|
31 |
|
|
|
|
|
32 |
|
33 |
-
|
|
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
- Transformers: 4.55.0
|
39 |
-
- Pytorch: 2.7.1+cu118
|
40 |
-
- Datasets: 4.0.0
|
41 |
-
- Tokenizers: 0.21.4
|
42 |
|
43 |
-
##
|
44 |
|
|
|
|
|
|
|
|
|
|
|
45 |
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
-
Cite TRL as:
|
48 |
-
|
49 |
```bibtex
|
50 |
-
@misc{
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
publisher = {GitHub},
|
56 |
-
howpublished = {\url{https://github.com/huggingface/trl}}
|
57 |
}
|
58 |
-
```
|
|
|
1 |
---
|
|
|
|
|
|
|
2 |
tags:
|
3 |
+
- pytorch
|
4 |
+
- safetensors
|
5 |
+
- transformers
|
6 |
+
- gpt-oss
|
7 |
+
- multilingual
|
8 |
+
- text-generation
|
9 |
+
language:
|
10 |
+
- en
|
11 |
+
- es
|
12 |
+
- fr
|
13 |
+
- de
|
14 |
+
- it
|
15 |
+
- pt
|
16 |
+
license: apache-2.0
|
17 |
+
model_type: gpt-oss
|
18 |
+
pipeline_tag: text-generation
|
19 |
+
base_model: openai/gpt-oss-20b
|
20 |
---
|
21 |
|
22 |
+
# GPT-OSS-20B Function Calling Model
|
23 |
+
|
24 |
+
This repository contains the GPT-OSS-20B model fine-tuned on function calling data in PyTorch/Safetensors format, ready for use with the Transformers library.
|
25 |
+
|
26 |
+
## Model Details
|
27 |
+
|
28 |
+
- **Base Model:** openai/gpt-oss-20b
|
29 |
+
- **Fine-tuning Dataset:** Salesforce/xlam-function-calling-60k (2000 samples)
|
30 |
+
- **Fine-tuning Method:** LoRA (r=8, alpha=16)
|
31 |
+
- **Context Length:** 131,072 tokens
|
32 |
+
- **Model Size:** 20B parameters
|
33 |
+
|
34 |
+
## Files
|
35 |
+
|
36 |
+
- `model.safetensors`: Model weights in Safetensors format
|
37 |
+
- `config.json`: Model configuration
|
38 |
+
- `tokenizer.json`, `tokenizer_config.json`: Tokenizer files
|
39 |
+
- `generation_config.json`: Generation configuration
|
40 |
|
41 |
+
## Usage
|
|
|
42 |
|
43 |
+
### With Transformers Library
|
44 |
|
45 |
```python
|
46 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
47 |
|
48 |
+
# Load model and tokenizer
|
49 |
+
model = AutoModelForCausalLM.from_pretrained(
|
50 |
+
"cuijian0819/gpt-oss-20b-function-calling",
|
51 |
+
torch_dtype="auto",
|
52 |
+
device_map="auto"
|
53 |
+
)
|
54 |
+
tokenizer = AutoTokenizer.from_pretrained("cuijian0819/gpt-oss-20b-function-calling")
|
55 |
+
|
56 |
+
# Generate text
|
57 |
+
inputs = tokenizer("Your prompt here", return_tensors="pt")
|
58 |
+
outputs = model.generate(**inputs, max_length=100, temperature=0.7)
|
59 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
60 |
```
|
61 |
|
62 |
+
### Fine-tuning
|
63 |
+
|
64 |
+
This model can be further fine-tuned using standard PyTorch/Transformers workflows:
|
65 |
|
66 |
+
```python
|
67 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, Trainer, TrainingArguments
|
68 |
|
69 |
+
model = AutoModelForCausalLM.from_pretrained("cuijian0819/gpt-oss-20b-function-calling")
|
70 |
+
tokenizer = AutoTokenizer.from_pretrained("cuijian0819/gpt-oss-20b-function-calling")
|
71 |
|
72 |
+
# Your fine-tuning code here
|
73 |
+
```
|
74 |
|
75 |
+
## GGUF Version
|
76 |
|
77 |
+
For efficient inference with llama.cpp or Ollama, check out the GGUF version: [cuijian0819/gpt-oss-20b-function-calling-gguf](https://huggingface.co/cuijian0819/gpt-oss-20b-function-calling-gguf)
|
|
|
|
|
|
|
|
|
78 |
|
79 |
+
## Training Details
|
80 |
|
81 |
+
- **Training Epochs:** 2
|
82 |
+
- **Learning Rate:** 0.0002
|
83 |
+
- **Batch Size:** 4
|
84 |
+
- **Gradient Accumulation:** 4
|
85 |
+
- **Max Length:** 1024
|
86 |
|
87 |
+
## License
|
88 |
+
|
89 |
+
This model inherits the license from the base openai/gpt-oss-20b model.
|
90 |
+
|
91 |
+
## Citation
|
92 |
|
|
|
|
|
93 |
```bibtex
|
94 |
+
@misc{gpt-oss-20b-function-calling,
|
95 |
+
title={GPT-OSS-20B Function Calling Model},
|
96 |
+
author={cuijian0819},
|
97 |
+
year={2025},
|
98 |
+
url={https://huggingface.co/cuijian0819/gpt-oss-20b-function-calling}
|
|
|
|
|
99 |
}
|
100 |
+
```
|