File size: 2,575 Bytes
8fdcf9c
cadcedb
29906cf
 
c3424da
29906cf
 
 
 
 
 
 
 
 
 
 
 
 
 
8fdcf9c
 
29906cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8fdcf9c
29906cf
8fdcf9c
29906cf
8fdcf9c
 
29906cf
8fdcf9c
29906cf
 
 
 
 
 
 
 
 
 
 
 
8fdcf9c
 
29906cf
 
 
8fdcf9c
29906cf
 
8fdcf9c
29906cf
 
8fdcf9c
29906cf
 
8fdcf9c
29906cf
8fdcf9c
29906cf
8fdcf9c
29906cf
8fdcf9c
29906cf
 
 
 
 
8fdcf9c
29906cf
 
 
 
 
8fdcf9c
 
29906cf
 
 
 
 
8fdcf9c
29906cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
tags:
- pytorch
- safetensors
- transformers
- gpt-oss
- multilingual
- text-generation
language:
- en
- es
- fr
- de
- it
- pt
license: apache-2.0
model_type: gpt-oss
pipeline_tag: text-generation
base_model: openai/gpt-oss-20b
---

# GPT-OSS-20B Function Calling Model

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.

## Model Details

- **Base Model:** openai/gpt-oss-20b
- **Fine-tuning Dataset:** Salesforce/xlam-function-calling-60k (2000 samples)
- **Fine-tuning Method:** LoRA (r=8, alpha=16)
- **Context Length:** 131,072 tokens
- **Model Size:** 20B parameters

## Files

- `model.safetensors`: Model weights in Safetensors format
- `config.json`: Model configuration
- `tokenizer.json`, `tokenizer_config.json`: Tokenizer files
- `generation_config.json`: Generation configuration

## Usage

### With Transformers Library

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
    "cuijian0819/gpt-oss-20b-function-calling",
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("cuijian0819/gpt-oss-20b-function-calling")

# Generate text
inputs = tokenizer("Your prompt here", return_tensors="pt")
outputs = model.generate(**inputs, max_length=100, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
```

### Fine-tuning

This model can be further fine-tuned using standard PyTorch/Transformers workflows:

```python
from transformers import AutoModelForCausalLM, AutoTokenizer, Trainer, TrainingArguments

model = AutoModelForCausalLM.from_pretrained("cuijian0819/gpt-oss-20b-function-calling")
tokenizer = AutoTokenizer.from_pretrained("cuijian0819/gpt-oss-20b-function-calling")

# Your fine-tuning code here
```

## GGUF Version

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)

## Training Details

- **Training Epochs:** 5
- **Learning Rate:** 0.0002
- **Batch Size:** 4
- **Gradient Accumulation:** 4
- **Max Length:** 1024

## License

This model inherits the license from the base openai/gpt-oss-20b model.

## Citation

```bibtex
@misc{gpt-oss-20b-function-calling,
  title={GPT-OSS-20B Function Calling Model},
  author={cuijian0819},
  year={2025},
  url={https://huggingface.co/cuijian0819/gpt-oss-20b-function-calling}
}
```