cuijian0819 commited on
Commit
cadcedb
·
verified ·
1 Parent(s): 2aa1751

Add PyTorch model files

Browse files
Files changed (1) hide show
  1. README.md +36 -78
README.md CHANGED
@@ -1,100 +1,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
- ```
 
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  base_model: openai/gpt-oss-20b
3
+ library_name: transformers
4
+ model_name: fine_tuned
5
+ tags:
6
+ - generated_from_trainer
7
+ - trl
8
+ - sft
9
+ licence: license
10
  ---
11
 
12
+ # Model Card for fine_tuned
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ This model is a fine-tuned version of [openai/gpt-oss-20b](https://huggingface.co/openai/gpt-oss-20b).
15
+ It has been trained using [TRL](https://github.com/huggingface/trl).
16
 
17
+ ## Quick start
18
 
19
  ```python
20
+ from transformers import pipeline
21
 
22
+ 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?"
23
+ generator = pipeline("text-generation", model="cuijian0819/fine_tuned", device="cuda")
24
+ output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
25
+ print(output["generated_text"])
 
 
 
 
 
 
 
 
26
  ```
27
 
28
+ ## Training procedure
 
 
29
 
30
+
 
31
 
 
 
32
 
33
+ This model was trained with SFT.
 
34
 
35
+ ### Framework versions
36
 
37
+ - TRL: 0.21.0
38
+ - Transformers: 4.55.0
39
+ - Pytorch: 2.7.1+cu118
40
+ - Datasets: 4.0.0
41
+ - Tokenizers: 0.21.4
42
 
43
+ ## Citations
44
 
 
 
 
 
 
45
 
 
 
 
 
 
46
 
47
+ Cite TRL as:
48
+
49
  ```bibtex
50
+ @misc{vonwerra2022trl,
51
+ title = {{TRL: Transformer Reinforcement Learning}},
52
+ 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},
53
+ year = 2020,
54
+ journal = {GitHub repository},
55
+ publisher = {GitHub},
56
+ howpublished = {\url{https://github.com/huggingface/trl}}
57
  }
58
+ ```