cuijian0819 commited on
Commit
555370d
·
verified ·
1 Parent(s): 22b7872

Add comprehensive README

Browse files
Files changed (1) hide show
  1. README.md +77 -38
README.md CHANGED
@@ -1,61 +1,100 @@
1
  ---
2
- base_model: openai/gpt-oss-20b
3
- library_name: peft
4
- model_name: fine_tuned
5
  tags:
6
- - base_model:adapter:openai/gpt-oss-20b
7
- - lora
8
- - sft
9
  - transformers
10
- - trl
11
- licence: license
 
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
- # Model Card for fine_tuned
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
- This model is a fine-tuned version of [openai/gpt-oss-20b](https://huggingface.co/openai/gpt-oss-20b).
17
- It has been trained using [TRL](https://github.com/huggingface/trl).
18
 
19
- ## Quick start
20
 
21
  ```python
22
- from transformers import pipeline
23
 
24
- question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
25
- generator = pipeline("text-generation", model="None", device="cuda")
26
- output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
27
- print(output["generated_text"])
 
 
 
 
 
 
 
 
28
  ```
29
 
30
- ## Training procedure
 
 
31
 
32
-
 
33
 
 
 
34
 
35
- This model was trained with SFT.
 
36
 
37
- ### Framework versions
38
 
39
- - PEFT 0.17.0
40
- - TRL: 0.21.0
41
- - Transformers: 4.55.0
42
- - Pytorch: 2.7.1+cu118
43
- - Datasets: 4.0.0
44
- - Tokenizers: 0.21.4
45
 
46
- ## Citations
47
 
 
 
 
 
 
48
 
 
 
 
 
 
49
 
50
- Cite TRL as:
51
-
52
  ```bibtex
53
- @misc{vonwerra2022trl,
54
- title = {{TRL: Transformer Reinforcement Learning}},
55
- author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
56
- year = 2020,
57
- journal = {GitHub repository},
58
- publisher = {GitHub},
59
- howpublished = {\url{https://github.com/huggingface/trl}}
60
  }
61
- ```
 
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 (200 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
+ ```