初始化项目,由ModelHub XC社区提供模型
Model: prithivMLmods/Llama3.2-3B-Grpo-Exp Source: Original Platform
This commit is contained in:
49
.gitattributes
vendored
Normal file
49
.gitattributes
vendored
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.db* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ark* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
|
||||||
|
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gguf* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ggml filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.llamafile* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
||||||
|
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||||
90
README.md
Normal file
90
README.md
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
---
|
||||||
|
license: llama3.2
|
||||||
|
language:
|
||||||
|
- en
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
library_name: transformers
|
||||||
|
tags:
|
||||||
|
- text-generation-inference
|
||||||
|
---
|
||||||
|

|
||||||
|
|
||||||
|
# **Llama3.2-3B-Grpo-Exp**
|
||||||
|
> The **Llama3.2-3B-Grpo-Exp** is a fine-tuned version of the **Llama-3.1-8B** base model, further enhanced with the **GSM8K dataset** for superior text generation and mathematical reasoning. This model is designed for advanced reasoning, structured problem-solving, and contextually rich outputs, making it an excellent choice for applications in **education, programming, research, and creative writing**.
|
||||||
|
|
||||||
|
With its optimized architecture, **Llama3.2-3B-Grpo-Exp** excels at:
|
||||||
|
- **Logical reasoning** and **step-by-step problem-solving**
|
||||||
|
- **Mathematical and coding tasks**, leveraging specialized expert models
|
||||||
|
- **Generating long-form content** (up to 8K tokens) with improved coherence
|
||||||
|
- **Understanding structured data**, including tables and JSON outputs
|
||||||
|
- **Following instructions** and **adapting to diverse system prompts**, making it ideal for chatbots and AI assistants
|
||||||
|
|
||||||
|
## **Key Features**
|
||||||
|
- **Supports long-context processing** of up to **128K tokens**
|
||||||
|
- **Fine-tuned using Supervised Fine-Tuning (SFT) and Reinforcement Learning with Human Feedback (RLHF)**
|
||||||
|
|
||||||
|
## **Model Architecture**
|
||||||
|
Llama3.2-3B-Grpo-Exp is built on the optimized transformer architecture of **Llama-3.1-8B**, integrating **enhanced dataset logits from GSM8K** for better mathematical reasoning and structured output generation.
|
||||||
|
|
||||||
|
## **Using with transformers**
|
||||||
|
To run conversational inference using `transformers >= 4.43.0`, use the `pipeline` abstraction or leverage the `generate()` function with the Auto classes.
|
||||||
|
|
||||||
|
Ensure your environment is updated with:
|
||||||
|
```bash
|
||||||
|
pip install --upgrade transformers
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Example Usage**
|
||||||
|
```python
|
||||||
|
import torch
|
||||||
|
from transformers import pipeline
|
||||||
|
|
||||||
|
model_id = "prithivMLmods/Llama3.2-3B-Grpo-Exp"
|
||||||
|
pipe = pipeline(
|
||||||
|
"text-generation",
|
||||||
|
model=model_id,
|
||||||
|
torch_dtype=torch.bfloat16,
|
||||||
|
device_map="auto",
|
||||||
|
)
|
||||||
|
|
||||||
|
messages = [
|
||||||
|
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
|
||||||
|
{"role": "user", "content": "Who are you?"},
|
||||||
|
]
|
||||||
|
|
||||||
|
outputs = pipe(
|
||||||
|
messages,
|
||||||
|
max_new_tokens=256,
|
||||||
|
)
|
||||||
|
print(outputs[0]["generated_text"][-1])
|
||||||
|
```
|
||||||
|
|
||||||
|
## **Intended Use**
|
||||||
|
**Llama3.2-3B-Grpo-Exp** is designed for a wide range of applications requiring deep reasoning, structured outputs, and logical text generation. It is particularly suited for:
|
||||||
|
|
||||||
|
- **Education & Research**: Generating detailed explanations, step-by-step solutions, and structured academic content.
|
||||||
|
- **Programming & Code Generation**: Assisting in code writing, debugging, and algorithm explanations with improved logic structuring.
|
||||||
|
- **AI Chatbots & Assistants**: Providing context-aware, instruction-following responses for conversational AI applications.
|
||||||
|
- **Creative Writing**: Generating high-quality stories, articles, and structured narratives with coherence.
|
||||||
|
- **Data Analysis & Structured Output Generation**: Interpreting and generating JSON, tables, and formatted outputs for structured data processing.
|
||||||
|
|
||||||
|
## **Limitations**
|
||||||
|
While **Llama3.2-3B-Grpo-Exp** is optimized for deep reasoning and structured outputs, it has some limitations:
|
||||||
|
|
||||||
|
1. **Not a Real-time Knowledge Source**
|
||||||
|
- The model is trained on a fixed dataset and does not have real-time internet access. It may not provide up-to-date information on rapidly evolving topics.
|
||||||
|
|
||||||
|
2. **Potential Biases**
|
||||||
|
- As with all AI models, responses may reflect biases present in the training data. Users should critically evaluate outputs, especially in sensitive domains.
|
||||||
|
|
||||||
|
3. **Mathematical & Logical Reasoning Constraints**
|
||||||
|
- While strong in step-by-step reasoning, it may occasionally produce incorrect mathematical calculations or logical inconsistencies. External verification is recommended for critical applications.
|
||||||
|
|
||||||
|
4. **Handling of Extremely Long Contexts**
|
||||||
|
- While it supports up to 128K tokens, efficiency and coherence may degrade when processing very long documents or conversations.
|
||||||
|
|
||||||
|
5. **Limited Handling of Ambiguity**
|
||||||
|
- The model may struggle with highly ambiguous or context-dependent queries, sometimes generating plausible but incorrect responses.
|
||||||
|
|
||||||
|
6. **Ethical & Compliance Considerations**
|
||||||
|
- Not intended for generating misinformation, automating legal or medical decisions, or other high-risk applications without human oversight.
|
||||||
36
config.json
Normal file
36
config.json
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"architectures": [
|
||||||
|
"LlamaForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_bias": false,
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 128000,
|
||||||
|
"eos_token_id": 128009,
|
||||||
|
"head_dim": 128,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 3072,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 8192,
|
||||||
|
"max_position_embeddings": 131072,
|
||||||
|
"mlp_bias": false,
|
||||||
|
"model_type": "llama",
|
||||||
|
"num_attention_heads": 24,
|
||||||
|
"num_hidden_layers": 28,
|
||||||
|
"num_key_value_heads": 8,
|
||||||
|
"pad_token_id": 128004,
|
||||||
|
"pretraining_tp": 1,
|
||||||
|
"rms_norm_eps": 1e-05,
|
||||||
|
"rope_scaling": {
|
||||||
|
"factor": 32.0,
|
||||||
|
"high_freq_factor": 4.0,
|
||||||
|
"low_freq_factor": 1.0,
|
||||||
|
"original_max_position_embeddings": 8192,
|
||||||
|
"rope_type": "llama3"
|
||||||
|
},
|
||||||
|
"rope_theta": 500000.0,
|
||||||
|
"tie_word_embeddings": true,
|
||||||
|
"torch_dtype": "float16",
|
||||||
|
"transformers_version": "4.48.3",
|
||||||
|
"use_cache": true,
|
||||||
|
"vocab_size": 128256
|
||||||
|
}
|
||||||
1
configuration.json
Normal file
1
configuration.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}
|
||||||
8
generation_config.json
Normal file
8
generation_config.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"_from_model_config": true,
|
||||||
|
"bos_token_id": 128000,
|
||||||
|
"eos_token_id": 128009,
|
||||||
|
"max_length": 131072,
|
||||||
|
"pad_token_id": 0,
|
||||||
|
"transformers_version": "4.48.3"
|
||||||
|
}
|
||||||
3
pytorch_model-00001-of-00002.bin
Normal file
3
pytorch_model-00001-of-00002.bin
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:cd5f6084c79312d990597467a8a036bafc6bcfb6700954167cd62d3e647512ec
|
||||||
|
size 4967416455
|
||||||
3
pytorch_model-00002-of-00002.bin
Normal file
3
pytorch_model-00002-of-00002.bin
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:7040f7f3705d3ad7e289a2039f113f0469c6d2364d065051f933af221298e33f
|
||||||
|
size 1459745440
|
||||||
3
pytorch_model.bin.index.json
Normal file
3
pytorch_model.bin.index.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:20c349a6cb438b60a3868ba32aff332d843c645b304aa73f38ab3dbc373d850d
|
||||||
|
size 20919
|
||||||
23
special_tokens_map.json
Normal file
23
special_tokens_map.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<|begin_of_text|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"content": "<|eot_id|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"pad_token": {
|
||||||
|
"content": "<|finetune_right_pad_id|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a65c6c5f9764771aa485e6a1f5e63d7d9af8477fe0777148c17476ecb2e09a05
|
||||||
|
size 17210099
|
||||||
2067
tokenizer_config.json
Normal file
2067
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user