Upload folder using huggingface_hub
Browse files- README.md +118 -0
- config.json +44 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer_config.json +75 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- te
|
| 5 |
+
- sa
|
| 6 |
+
tags:
|
| 7 |
+
- text-generation
|
| 8 |
+
- structured-data
|
| 9 |
+
- multilingual
|
| 10 |
+
- deepseek
|
| 11 |
+
- no-domain
|
| 12 |
+
license: apache-2.0
|
| 13 |
+
datasets:
|
| 14 |
+
- custom
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Fine-tuned SLM T2 - Structured Data Generation (No Domain)
|
| 19 |
+
|
| 20 |
+
This model is fine-tuned for generating natural language sentences from structured data **without domain labels**.
|
| 21 |
+
|
| 22 |
+
## Model Details
|
| 23 |
+
|
| 24 |
+
- **Base Model**: DeepSeek V3 Compact (~110M parameters)
|
| 25 |
+
- **Task**: Structured data to text generation
|
| 26 |
+
- **Languages**: English, Telugu, Sanskrit
|
| 27 |
+
- **Training Format**: `Generate a sentence from this data: {key: value, ...}`
|
| 28 |
+
- **Domains**: Sports, Weather, Travel, Movies, Products
|
| 29 |
+
|
| 30 |
+
## Usage
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 34 |
+
|
| 35 |
+
model = AutoModelForCausalLM.from_pretrained("asrith05/finetuned_slm_t2")
|
| 36 |
+
tokenizer = AutoTokenizer.from_pretrained("asrith05/finetuned_slm_t2")
|
| 37 |
+
|
| 38 |
+
# Example: Sports data
|
| 39 |
+
prompt = "Generate a sentence from this data: {Team1: 'Lakers', Score1: 108, Team2: 'Warriors', Score2: 90}"
|
| 40 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 41 |
+
outputs = model.generate(**inputs, max_new_tokens=50, temperature=0.8)
|
| 42 |
+
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 43 |
+
print(result)
|
| 44 |
+
# Expected: "Generate a sentence from this data: {Team1: 'Lakers', Score1: 108, Team2: 'Warriors', Score2: 90} The Lakers won the game against the Warriors with a final score of 108 to 90."
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Training Details
|
| 48 |
+
|
| 49 |
+
- **Dataset Split**: 24k train / 6k validation / 6k test
|
| 50 |
+
- **Epochs**: 1 epoch
|
| 51 |
+
- **Learning Rate**: 5e-5
|
| 52 |
+
- **Batch Size**: 4 with gradient accumulation
|
| 53 |
+
- **Format**: No domain labels, direct structured data to text
|
| 54 |
+
|
| 55 |
+
## Supported Data Types
|
| 56 |
+
|
| 57 |
+
### Sports
|
| 58 |
+
```
|
| 59 |
+
Generate a sentence from this data: {Team1: 'Mumbai Indians', Score1: 185, Team2: 'Chennai Super Kings', Score2: 180}
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
### Weather
|
| 63 |
+
```
|
| 64 |
+
Generate a sentence from this data: {City: 'Hyderabad', Temperature: 32, Condition: 'sunny', Day: 'Monday'}
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
### Travel
|
| 68 |
+
```
|
| 69 |
+
Generate a sentence from this data: {Person: 'Priya', City: 'Bangalore', Transport: 'flight', Duration: 2}
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
### Movies
|
| 73 |
+
```
|
| 74 |
+
Generate a sentence from this data: {Movie: 'RRR', Genre: 'Action', Rating: 8.2, Year: 2022}
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
### Products
|
| 78 |
+
```
|
| 79 |
+
Generate a sentence from this data: {Product: 'iPhone', Brand: 'Apple', Price: 999, Rating: 4.5}
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
## Key Features
|
| 83 |
+
|
| 84 |
+
- **Domain-Agnostic**: No need to specify domain in input
|
| 85 |
+
- **Clean Format**: Simple structured data input
|
| 86 |
+
- **Multilingual**: Supports English, Telugu, Sanskrit
|
| 87 |
+
- **Versatile**: Works across multiple data types
|
| 88 |
+
|
| 89 |
+
## Model Performance
|
| 90 |
+
|
| 91 |
+
- Trained on diverse structured data examples
|
| 92 |
+
- Optimized for coherent natural language generation
|
| 93 |
+
- Validated on hold-out test set
|
| 94 |
+
- Supports temperature-based generation control
|
| 95 |
+
|
| 96 |
+
## Limitations
|
| 97 |
+
|
| 98 |
+
- Best performance on data similar to training format
|
| 99 |
+
- May struggle with deeply nested structures
|
| 100 |
+
- Requires well-formatted input dictionaries
|
| 101 |
+
- Limited to domains seen during training
|
| 102 |
+
|
| 103 |
+
## Related Models
|
| 104 |
+
|
| 105 |
+
- [asrith05/finetuned_slm_t2_diverse](https://huggingface.co/asrith05/finetuned_slm_t2_diverse) - Multi-domain with labels
|
| 106 |
+
- [asrith05/slm](https://huggingface.co/asrith05/slm) - Entity extraction model
|
| 107 |
+
- [asrith05/deepseek_pretrain_90k](https://huggingface.co/asrith05/deepseek_pretrain_90k) - Pretrained base
|
| 108 |
+
|
| 109 |
+
## Citation
|
| 110 |
+
|
| 111 |
+
```bibtex
|
| 112 |
+
@model{finetuned_slm_t2,
|
| 113 |
+
title={Fine-tuned SLM T2: Structured Data Generation},
|
| 114 |
+
author={Asrith},
|
| 115 |
+
year={2024},
|
| 116 |
+
url={https://huggingface.co/asrith05/finetuned_slm_t2}
|
| 117 |
+
}
|
| 118 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DeepseekV3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"eos_token_id": 1,
|
| 9 |
+
"first_k_dense_replace": 4,
|
| 10 |
+
"head_dim": 64,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 768,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 3072,
|
| 15 |
+
"kv_lora_rank": 512,
|
| 16 |
+
"max_position_embeddings": 4096,
|
| 17 |
+
"model_type": "deepseek_v3",
|
| 18 |
+
"moe_intermediate_size": 2048,
|
| 19 |
+
"n_group": 8,
|
| 20 |
+
"n_routed_experts": 0,
|
| 21 |
+
"n_shared_experts": 1,
|
| 22 |
+
"norm_topk_prob": true,
|
| 23 |
+
"num_attention_heads": 12,
|
| 24 |
+
"num_experts_per_tok": 8,
|
| 25 |
+
"num_hidden_layers": 4,
|
| 26 |
+
"num_key_value_heads": 12,
|
| 27 |
+
"pretraining_tp": 1,
|
| 28 |
+
"q_lora_rank": 1536,
|
| 29 |
+
"qk_head_dim": 192,
|
| 30 |
+
"qk_nope_head_dim": 128,
|
| 31 |
+
"qk_rope_head_dim": 64,
|
| 32 |
+
"rms_norm_eps": 1e-06,
|
| 33 |
+
"rope_interleave": true,
|
| 34 |
+
"rope_scaling": null,
|
| 35 |
+
"rope_theta": 10000.0,
|
| 36 |
+
"routed_scaling_factor": 2.5,
|
| 37 |
+
"tie_word_embeddings": false,
|
| 38 |
+
"topk_group": 4,
|
| 39 |
+
"torch_dtype": "float32",
|
| 40 |
+
"transformers_version": "4.51.3",
|
| 41 |
+
"use_cache": false,
|
| 42 |
+
"v_head_dim": 128,
|
| 43 |
+
"vocab_size": 32000
|
| 44 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 1,
|
| 5 |
+
"transformers_version": "4.51.3"
|
| 6 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:de350ca565dbe4a0c2576dbd6c06fd9cd4077620d720cf5c4a2d957656b14008
|
| 3 |
+
size 436535952
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "</s>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "</s>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
}
|
| 23 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<unk>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<pad>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "<s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "</s>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"4": {
|
| 36 |
+
"content": "<en>",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
},
|
| 43 |
+
"5": {
|
| 44 |
+
"content": "<te>",
|
| 45 |
+
"lstrip": false,
|
| 46 |
+
"normalized": false,
|
| 47 |
+
"rstrip": false,
|
| 48 |
+
"single_word": false,
|
| 49 |
+
"special": true
|
| 50 |
+
},
|
| 51 |
+
"6": {
|
| 52 |
+
"content": "<sa>",
|
| 53 |
+
"lstrip": false,
|
| 54 |
+
"normalized": false,
|
| 55 |
+
"rstrip": false,
|
| 56 |
+
"single_word": false,
|
| 57 |
+
"special": true
|
| 58 |
+
},
|
| 59 |
+
"7": {
|
| 60 |
+
"content": "<mask>",
|
| 61 |
+
"lstrip": false,
|
| 62 |
+
"normalized": false,
|
| 63 |
+
"rstrip": false,
|
| 64 |
+
"single_word": false,
|
| 65 |
+
"special": true
|
| 66 |
+
}
|
| 67 |
+
},
|
| 68 |
+
"bos_token": "<s>",
|
| 69 |
+
"clean_up_tokenization_spaces": false,
|
| 70 |
+
"eos_token": "</s>",
|
| 71 |
+
"extra_special_tokens": {},
|
| 72 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 73 |
+
"pad_token": "</s>",
|
| 74 |
+
"tokenizer_class": "PreTrainedTokenizer"
|
| 75 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02fa4890d43ae1dfef7a3e238d1c0055c35b415b279c0a199a0f53f6d22ce47e
|
| 3 |
+
size 5304
|