Text Generation
Transformers
Safetensors
phi3
Generated from Trainer
trl
grpo
conversational
custom_code
text-generation-inference
Instructions to use harsha070/expfinal-phi-mbpp-s42-lambda-0p0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harsha070/expfinal-phi-mbpp-s42-lambda-0p0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="harsha070/expfinal-phi-mbpp-s42-lambda-0p0", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("harsha070/expfinal-phi-mbpp-s42-lambda-0p0", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("harsha070/expfinal-phi-mbpp-s42-lambda-0p0", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use harsha070/expfinal-phi-mbpp-s42-lambda-0p0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "harsha070/expfinal-phi-mbpp-s42-lambda-0p0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "harsha070/expfinal-phi-mbpp-s42-lambda-0p0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/harsha070/expfinal-phi-mbpp-s42-lambda-0p0
- SGLang
How to use harsha070/expfinal-phi-mbpp-s42-lambda-0p0 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "harsha070/expfinal-phi-mbpp-s42-lambda-0p0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "harsha070/expfinal-phi-mbpp-s42-lambda-0p0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "harsha070/expfinal-phi-mbpp-s42-lambda-0p0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "harsha070/expfinal-phi-mbpp-s42-lambda-0p0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use harsha070/expfinal-phi-mbpp-s42-lambda-0p0 with Docker Model Runner:
docker model run hf.co/harsha070/expfinal-phi-mbpp-s42-lambda-0p0
Training in progress, step 10
Browse files- README.md +67 -0
- chat_template.jinja +8 -0
- completions/completions_00010.parquet +3 -0
- config.json +140 -0
- generation_config.json +11 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +16 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: harsha070/sft-warmup-phi-v1
|
| 3 |
+
library_name: transformers
|
| 4 |
+
model_name: expfinal-phi-mbpp-s42-lambda-0p0
|
| 5 |
+
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
- trl
|
| 8 |
+
- grpo
|
| 9 |
+
licence: license
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Model Card for expfinal-phi-mbpp-s42-lambda-0p0
|
| 13 |
+
|
| 14 |
+
This model is a fine-tuned version of [harsha070/sft-warmup-phi-v1](https://huggingface.co/harsha070/sft-warmup-phi-v1).
|
| 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="harsha070/expfinal-phi-mbpp-s42-lambda-0p0", 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 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/models-self5933/obfuscation-early-warning/runs/mx8nl2gc)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
This model was trained with GRPO, a method introduced in [DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models](https://huggingface.co/papers/2402.03300).
|
| 35 |
+
|
| 36 |
+
### Framework versions
|
| 37 |
+
|
| 38 |
+
- TRL: 1.3.0
|
| 39 |
+
- Transformers: 5.8.0
|
| 40 |
+
- Pytorch: 2.11.0
|
| 41 |
+
- Datasets: 4.8.5
|
| 42 |
+
- Tokenizers: 0.22.2
|
| 43 |
+
|
| 44 |
+
## Citations
|
| 45 |
+
|
| 46 |
+
Cite GRPO as:
|
| 47 |
+
|
| 48 |
+
```bibtex
|
| 49 |
+
@article{shao2024deepseekmath,
|
| 50 |
+
title = {{DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models}},
|
| 51 |
+
author = {Zhihong Shao and Peiyi Wang and Qihao Zhu and Runxin Xu and Junxiao Song and Mingchuan Zhang and Y. K. Li and Y. Wu and Daya Guo},
|
| 52 |
+
year = 2024,
|
| 53 |
+
eprint = {arXiv:2402.03300},
|
| 54 |
+
}
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
Cite TRL as:
|
| 58 |
+
|
| 59 |
+
```bibtex
|
| 60 |
+
@software{vonwerra2020trl,
|
| 61 |
+
title = {{TRL: Transformers Reinforcement Learning}},
|
| 62 |
+
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
|
| 63 |
+
license = {Apache-2.0},
|
| 64 |
+
url = {https://github.com/huggingface/trl},
|
| 65 |
+
year = {2020}
|
| 66 |
+
}
|
| 67 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% for message in messages %}{% if message['role'] == 'system' and message['content'] %}{{'<|system|>
|
| 2 |
+
' + message['content'] + '<|end|>
|
| 3 |
+
'}}{% elif message['role'] == 'user' %}{{'<|user|>
|
| 4 |
+
' + message['content'] + '<|end|>
|
| 5 |
+
'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>
|
| 6 |
+
' + message['content'] + '<|end|>
|
| 7 |
+
'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>
|
| 8 |
+
' }}{% else %}{{ eos_token }}{% endif %}
|
completions/completions_00010.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e17e081cd3bd7b7a8a1afddf3b3e7022dc9f2539a8b9d3b0761a667ab5680f48
|
| 3 |
+
size 17826
|
config.json
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Phi3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_phi3.Phi3Config",
|
| 9 |
+
"AutoModelForCausalLM": "modeling_phi3.Phi3ForCausalLM"
|
| 10 |
+
},
|
| 11 |
+
"bos_token_id": 1,
|
| 12 |
+
"dtype": "bfloat16",
|
| 13 |
+
"embd_pdrop": 0.0,
|
| 14 |
+
"eos_token_id": 32000,
|
| 15 |
+
"hidden_act": "silu",
|
| 16 |
+
"hidden_size": 3072,
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
+
"intermediate_size": 8192,
|
| 19 |
+
"max_position_embeddings": 131072,
|
| 20 |
+
"model_type": "phi3",
|
| 21 |
+
"num_attention_heads": 32,
|
| 22 |
+
"num_hidden_layers": 32,
|
| 23 |
+
"num_key_value_heads": 32,
|
| 24 |
+
"original_max_position_embeddings": 4096,
|
| 25 |
+
"pad_token_id": 32000,
|
| 26 |
+
"resid_pdrop": 0.0,
|
| 27 |
+
"rms_norm_eps": 1e-05,
|
| 28 |
+
"rope_parameters": {
|
| 29 |
+
"long_factor": [
|
| 30 |
+
1.0800000429153442,
|
| 31 |
+
1.1100000143051147,
|
| 32 |
+
1.1399999856948853,
|
| 33 |
+
1.340000033378601,
|
| 34 |
+
1.5899999141693115,
|
| 35 |
+
1.600000023841858,
|
| 36 |
+
1.6200000047683716,
|
| 37 |
+
2.620000123977661,
|
| 38 |
+
3.2300000190734863,
|
| 39 |
+
3.2300000190734863,
|
| 40 |
+
4.789999961853027,
|
| 41 |
+
7.400000095367432,
|
| 42 |
+
7.700000286102295,
|
| 43 |
+
9.09000015258789,
|
| 44 |
+
12.199999809265137,
|
| 45 |
+
17.670000076293945,
|
| 46 |
+
24.46000099182129,
|
| 47 |
+
28.57000160217285,
|
| 48 |
+
30.420001983642578,
|
| 49 |
+
30.840002059936523,
|
| 50 |
+
32.590003967285156,
|
| 51 |
+
32.93000411987305,
|
| 52 |
+
42.320003509521484,
|
| 53 |
+
44.96000289916992,
|
| 54 |
+
50.340003967285156,
|
| 55 |
+
50.45000457763672,
|
| 56 |
+
57.55000305175781,
|
| 57 |
+
57.93000411987305,
|
| 58 |
+
58.21000289916992,
|
| 59 |
+
60.1400032043457,
|
| 60 |
+
62.61000442504883,
|
| 61 |
+
62.62000274658203,
|
| 62 |
+
62.71000289916992,
|
| 63 |
+
63.1400032043457,
|
| 64 |
+
63.1400032043457,
|
| 65 |
+
63.77000427246094,
|
| 66 |
+
63.93000411987305,
|
| 67 |
+
63.96000289916992,
|
| 68 |
+
63.970001220703125,
|
| 69 |
+
64.02999877929688,
|
| 70 |
+
64.06999969482422,
|
| 71 |
+
64.08000183105469,
|
| 72 |
+
64.12000274658203,
|
| 73 |
+
64.41000366210938,
|
| 74 |
+
64.4800033569336,
|
| 75 |
+
64.51000213623047,
|
| 76 |
+
64.52999877929688,
|
| 77 |
+
64.83999633789062
|
| 78 |
+
],
|
| 79 |
+
"original_max_position_embeddings": 4096,
|
| 80 |
+
"partial_rotary_factor": 1.0,
|
| 81 |
+
"rope_theta": 10000.0,
|
| 82 |
+
"rope_type": "longrope",
|
| 83 |
+
"short_factor": [
|
| 84 |
+
1.0,
|
| 85 |
+
1.0199999809265137,
|
| 86 |
+
1.0299999713897705,
|
| 87 |
+
1.0299999713897705,
|
| 88 |
+
1.0499999523162842,
|
| 89 |
+
1.0499999523162842,
|
| 90 |
+
1.0499999523162842,
|
| 91 |
+
1.0499999523162842,
|
| 92 |
+
1.0499999523162842,
|
| 93 |
+
1.0699999332427979,
|
| 94 |
+
1.0999999046325684,
|
| 95 |
+
1.1099998950958252,
|
| 96 |
+
1.1599998474121094,
|
| 97 |
+
1.1599998474121094,
|
| 98 |
+
1.1699998378753662,
|
| 99 |
+
1.2899998426437378,
|
| 100 |
+
1.339999794960022,
|
| 101 |
+
1.679999828338623,
|
| 102 |
+
1.7899998426437378,
|
| 103 |
+
1.8199998140335083,
|
| 104 |
+
1.8499997854232788,
|
| 105 |
+
1.8799997568130493,
|
| 106 |
+
1.9099997282028198,
|
| 107 |
+
1.9399996995925903,
|
| 108 |
+
1.9899996519088745,
|
| 109 |
+
2.0199997425079346,
|
| 110 |
+
2.0199997425079346,
|
| 111 |
+
2.0199997425079346,
|
| 112 |
+
2.0199997425079346,
|
| 113 |
+
2.0199997425079346,
|
| 114 |
+
2.0199997425079346,
|
| 115 |
+
2.0299997329711914,
|
| 116 |
+
2.0299997329711914,
|
| 117 |
+
2.0299997329711914,
|
| 118 |
+
2.0299997329711914,
|
| 119 |
+
2.0299997329711914,
|
| 120 |
+
2.0299997329711914,
|
| 121 |
+
2.0299997329711914,
|
| 122 |
+
2.0299997329711914,
|
| 123 |
+
2.0299997329711914,
|
| 124 |
+
2.0799996852874756,
|
| 125 |
+
2.0899996757507324,
|
| 126 |
+
2.189999580383301,
|
| 127 |
+
2.2199995517730713,
|
| 128 |
+
2.5899994373321533,
|
| 129 |
+
2.729999542236328,
|
| 130 |
+
2.749999523162842,
|
| 131 |
+
2.8399994373321533
|
| 132 |
+
],
|
| 133 |
+
"type": "longrope"
|
| 134 |
+
},
|
| 135 |
+
"sliding_window": 262144,
|
| 136 |
+
"tie_word_embeddings": false,
|
| 137 |
+
"transformers_version": "5.8.0",
|
| 138 |
+
"use_cache": false,
|
| 139 |
+
"vocab_size": 32064
|
| 140 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
32007,
|
| 6 |
+
32001,
|
| 7 |
+
32000
|
| 8 |
+
],
|
| 9 |
+
"pad_token_id": 32000,
|
| 10 |
+
"transformers_version": "5.8.0"
|
| 11 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:89ccd0076c711222ee1fb3b174ad3d323b45b18851b2980f1e50c70d928779c9
|
| 3 |
+
size 7642181896
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<s>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"is_local": false,
|
| 7 |
+
"legacy": false,
|
| 8 |
+
"local_files_only": false,
|
| 9 |
+
"model_max_length": 131072,
|
| 10 |
+
"pad_token": "<|endoftext|>",
|
| 11 |
+
"padding_side": "left",
|
| 12 |
+
"sp_model_kwargs": {},
|
| 13 |
+
"tokenizer_class": "TokenizersBackend",
|
| 14 |
+
"unk_token": "<unk>",
|
| 15 |
+
"use_default_system_prompt": false
|
| 16 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f41b31d4ea45f8f956c91084507520e50a808172be0ee21f4d074399d03c903
|
| 3 |
+
size 7249
|