raxder-ai commited on
Commit
fc7e729
·
verified ·
1 Parent(s): 1736a0c

Upload folder using huggingface_hub

Browse files
COMPANY.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RaxCore
2
+
3
+ **A leading developer company in Africa and beyond**
4
+
5
+ 🌐 **Website**: [www.raxcore.dev](https://www.raxcore.dev/)
6
+ 🤗 **Hugging Face**: [raxcore-dev](https://huggingface.co/raxcore-dev)
7
+
8
+ RaxCore is at the forefront of AI and software development, creating innovative solutions that bridge technology gaps across Africa and the global market.
9
+
10
+ ## About RaxCore
11
+
12
+ RaxCore specializes in:
13
+ - Advanced AI model development and fine-tuning
14
+ - Conversational AI systems
15
+ - Custom software solutions
16
+ - Technology consulting and implementation
17
+
18
+ ## Our Mission
19
+
20
+ To democratize access to cutting-edge AI technology while fostering innovation across Africa and beyond.
21
+
22
+ ## Rax 3.5 Chat
23
+
24
+ Rax 3.5 Chat represents RaxCore's commitment to developing high-quality, accessible AI models that serve diverse communities and use cases.
25
+
26
+ ---
27
+
28
+ **Contact RaxCore**
29
+ Visit [www.raxcore.dev](https://www.raxcore.dev/) for enterprise solutions, custom model development, and AI consulting services.
DEPLOYMENT.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Rax 3.5 Chat - Deployment Guide
2
+
3
+ ## Uploading to Hugging Face
4
+
5
+ ### Prerequisites
6
+ 1. Install required packages:
7
+ ```bash
8
+ pip install huggingface_hub transformers
9
+ ```
10
+
11
+ 2. Login to Hugging Face:
12
+ ```bash
13
+ huggingface-cli login
14
+ ```
15
+
16
+ ### Upload Steps
17
+
18
+ 1. **Initialize Git LFS** (if not already done):
19
+ ```bash
20
+ cd /home/ogega/Projects/models/rax-3.5-chat
21
+ git lfs install
22
+ ```
23
+
24
+ 2. **Add all files**:
25
+ ```bash
26
+ git add .
27
+ git commit -m "Initial commit: Rax 3.5 Chat model"
28
+ ```
29
+
30
+ 3. **Create repository on Hugging Face**:
31
+ - Go to https://huggingface.co/new
32
+ - Create a new model repository named "rax-3.5-chat" under raxcore-dev
33
+ - Choose "Public" or "Private" as needed
34
+
35
+ 4. **Push to Hugging Face**:
36
+ ```bash
37
+ git remote add origin https://huggingface.co/raxcore-dev/rax-3.5-chat
38
+ git branch -M main
39
+ git push -u origin main
40
+ ```
41
+
42
+ ### Alternative: Using huggingface_hub
43
+
44
+ ```python
45
+ from huggingface_hub import HfApi
46
+
47
+ api = HfApi()
48
+ api.upload_folder(
49
+ folder_path="/home/ogega/Projects/models/rax-3.5-chat",
50
+ repo_id="raxcore-dev/rax-3.5-chat",
51
+ repo_type="model"
52
+ )
53
+ ```
54
+
55
+ ## Model Testing
56
+
57
+ Run the included test script:
58
+ ```bash
59
+ cd /home/ogega/Projects/models/rax-3.5-chat
60
+ python test_rax.py
61
+ ```
62
+
63
+ ## Files Included
64
+
65
+ - `config.json` - Model configuration
66
+ - `tokenizer_config.json` - Tokenizer configuration
67
+ - `model.safetensors` - Model weights
68
+ - `tokenizer.json` - Tokenizer data
69
+ - `tokenizer.model` - SentencePiece model
70
+ - `generation_config.json` - Generation parameters
71
+ - `README.md` - Comprehensive documentation
72
+ - `model_card.md` - Hugging Face model card
73
+ - `test_rax.py` - Test script
74
+ - `.gitattributes` - Git LFS configuration
75
+
76
+ ## Ready for Release!
77
+
78
+ Your Rax 3.5 Chat model is now fully rebranded and ready for upload to Hugging Face.
README.md ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Rax 3.5 Chat
2
+
3
+ **Developed by RaxCore - A leading developer company in Africa and beyond**
4
+
5
+ Rax 3.5 Chat is a fine-tuned conversational AI model based on the Llama architecture. This model has been specifically optimized for chat interactions and dialogue generation.
6
+
7
+ ## Model Details
8
+
9
+ - **Model Name**: Rax 3.5 Chat
10
+ - **Architecture**: Llama (LlamaForCausalLM)
11
+ - **Parameters**: ~1.1B
12
+ - **Context Length**: 2048 tokens
13
+ - **Precision**: bfloat16
14
+ - **License**: Apache 2.0
15
+
16
+ ## Model Architecture
17
+
18
+ - **Hidden Size**: 2048
19
+ - **Intermediate Size**: 5632
20
+ - **Attention Heads**: 32
21
+ - **Key-Value Heads**: 4
22
+ - **Hidden Layers**: 22
23
+ - **Vocabulary Size**: 32,000
24
+
25
+ ## Usage
26
+
27
+ ### Quick Start
28
+
29
+ ```python
30
+ from transformers import AutoTokenizer, AutoModelForCausalLM
31
+ import torch
32
+
33
+ # Load model and tokenizer
34
+ tokenizer = AutoTokenizer.from_pretrained("rax-3.5-chat")
35
+ model = AutoModelForCausalLM.from_pretrained(
36
+ "rax-3.5-chat",
37
+ torch_dtype=torch.bfloat16,
38
+ device_map="auto"
39
+ )
40
+
41
+ # Chat template
42
+ messages = [
43
+ {"role": "system", "content": "You are Rax, a helpful AI assistant."},
44
+ {"role": "user", "content": "Hello! How are you?"}
45
+ ]
46
+
47
+ # Apply chat template
48
+ input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
49
+ inputs = tokenizer(input_text, return_tensors="pt")
50
+
51
+ # Generate response
52
+ with torch.no_grad():
53
+ outputs = model.generate(
54
+ **inputs,
55
+ max_new_tokens=256,
56
+ temperature=0.7,
57
+ do_sample=True,
58
+ pad_token_id=tokenizer.eos_token_id
59
+ )
60
+
61
+ response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
62
+ print(response)
63
+ ```
64
+
65
+ ### Chat Format
66
+
67
+ Rax 3.5 Chat uses the following conversation format:
68
+
69
+ ```
70
+ <|system|>
71
+ You are Rax, a helpful AI assistant.</s>
72
+ <|user|>
73
+ Hello! How are you?</s>
74
+ <|assistant|>
75
+ Hello! I'm doing well, thank you for asking. How can I help you today?</s>
76
+ ```
77
+
78
+ ## Training Details
79
+
80
+ This model was fine-tuned from TinyLlama with:
81
+ - Extended training over several days
82
+ - Optimized for conversational interactions
83
+ - Enhanced dialogue coherence and helpfulness
84
+
85
+ ## Intended Use
86
+
87
+ Rax 3.5 Chat is designed for:
88
+ - Conversational AI applications
89
+ - Chatbots and virtual assistants
90
+ - Educational and research purposes
91
+ - Creative writing assistance
92
+
93
+ ## Limitations
94
+
95
+ - Context window limited to 2048 tokens
96
+ - May generate incorrect or biased information
97
+ - Not suitable for production use without proper safety measures
98
+ - Requires responsible deployment practices
99
+
100
+ ## Ethical Considerations
101
+
102
+ Please use this model responsibly:
103
+ - Implement appropriate content filtering
104
+ - Monitor outputs for potential biases
105
+ - Ensure compliance with applicable regulations
106
+ - Consider the impact on users and society
107
+
108
+ ## Technical Specifications
109
+
110
+ - **Framework**: Transformers 4.35.0+
111
+ - **Hardware Requirements**: GPU with 4GB+ VRAM recommended
112
+ - **Inference Speed**: Optimized for real-time chat applications
113
+
114
+ ## Citation
115
+
116
+ If you use Rax 3.5 Chat in your research or applications, please cite:
117
+
118
+ ```bibtex
119
+ @misc{rax35chat2024,
120
+ title={Rax 3.5 Chat: A Fine-tuned Conversational AI Model},
121
+ author={RaxCore},
122
+ year={2024},
123
+ note={Fine-tuned from TinyLlama architecture},
124
+ organization={RaxCore - Leading developer company in Africa and beyond}
125
+ }
126
+ ```
127
+
128
+ ## Contact
129
+
130
+ For questions, issues, or collaboration opportunities:
131
+ - **Hugging Face**: https://huggingface.co/raxcore-dev
132
+ - **Website**: https://www.raxcore.dev/
133
+ - **Model Repository**: Contact RaxCore directly
134
+
135
+ ---
136
+
137
+ **RaxCore** - A leading developer company in Africa and beyond
138
+ 🌐 **Website**: [www.raxcore.dev](https://www.raxcore.dev/)
139
+ 🤗 **Hugging Face**: [raxcore-dev](https://huggingface.co/raxcore-dev)
140
+ *Rax 3.5 Chat - Powering the next generation of conversational AI*
config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "rax-3.5-chat",
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 2048,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 5632,
13
+ "max_position_embeddings": 2048,
14
+ "model_type": "llama",
15
+ "num_attention_heads": 32,
16
+ "num_hidden_layers": 22,
17
+ "num_key_value_heads": 4,
18
+ "pretraining_tp": 1,
19
+ "rms_norm_eps": 1e-05,
20
+ "rope_scaling": null,
21
+ "rope_theta": 10000.0,
22
+ "tie_word_embeddings": false,
23
+ "torch_dtype": "bfloat16",
24
+ "transformers_version": "4.35.0",
25
+ "use_cache": true,
26
+ "vocab_size": 32000
27
+ }
eval_results.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "eval_logits/chosen": -2.707406759262085,
4
+ "eval_logits/rejected": -2.656524419784546,
5
+ "eval_logps/chosen": -370.1297607421875,
6
+ "eval_logps/rejected": -296.0738525390625,
7
+ "eval_loss": 0.513750433921814,
8
+ "eval_rewards/accuracies": 0.738095223903656,
9
+ "eval_rewards/chosen": -0.02744222804903984,
10
+ "eval_rewards/margins": 1.0087225437164307,
11
+ "eval_rewards/rejected": -1.03616464138031,
12
+ "eval_runtime": 93.5908,
13
+ "eval_samples": 2000,
14
+ "eval_samples_per_second": 21.37,
15
+ "eval_steps_per_second": 0.673
16
+ }
generation_config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "max_length": 2048,
6
+ "pad_token_id": 2,
7
+ "transformers_version": "4.35.0"
8
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e6001da2106d4757498752a021df6c2bdc332c650aae4bae6b0c004dcf14933
3
+ size 2200119864
model_card.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - chat
8
+ - conversational
9
+ - llama
10
+ - fine-tuned
11
+ - rax
12
+ - raxcore
13
+ model_type: llama
14
+ ---
15
+
16
+ # Rax 3.5 Chat
17
+
18
+ **Developed by RaxCore - A leading developer company in Africa and beyond**
19
+
20
+ ## Model Description
21
+
22
+ Rax 3.5 Chat is a fine-tuned conversational AI model based on the Llama architecture, specifically optimized for chat interactions and dialogue generation. This model represents several days of careful fine-tuning to enhance conversational capabilities.
23
+
24
+ ## Quick Start
25
+
26
+ ```python
27
+ from transformers import AutoTokenizer, AutoModelForCausalLM
28
+
29
+ tokenizer = AutoTokenizer.from_pretrained("rax-3.5-chat")
30
+ model = AutoModelForCausalLM.from_pretrained("rax-3.5-chat")
31
+
32
+ messages = [
33
+ {"role": "system", "content": "You are Rax, a helpful AI assistant."},
34
+ {"role": "user", "content": "Hello!"}
35
+ ]
36
+
37
+ input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
38
+ inputs = tokenizer(input_text, return_tensors="pt")
39
+ outputs = model.generate(**inputs, max_new_tokens=256)
40
+ ```
41
+
42
+ ## Model Details
43
+
44
+ - **Architecture**: Llama (1.1B parameters)
45
+ - **Context Length**: 2048 tokens
46
+ - **Training**: Fine-tuned for conversational AI
47
+ - **License**: Apache 2.0
48
+
49
+ ## Intended Use
50
+
51
+ - Conversational AI applications
52
+ - Research and educational purposes
53
+ - Creative writing assistance
54
+ - Chatbot development
55
+
56
+ ## Limitations
57
+
58
+ - 2048 token context limit
59
+ - May generate biased or incorrect information
60
+ - Requires responsible deployment practices
61
+
62
+ ## Links
63
+
64
+ - **RaxCore Website**: [www.raxcore.dev](https://www.raxcore.dev/)
65
+ - **Hugging Face Profile**: [raxcore-dev](https://huggingface.co/raxcore-dev)
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
test_rax.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ Test script for Rax 3.5 Chat model
4
+ """
5
+
6
+ from transformers import AutoTokenizer, AutoModelForCausalLM
7
+ import torch
8
+
9
+ def test_rax_chat():
10
+ print("Loading Rax 3.5 Chat model...")
11
+
12
+ # Load model and tokenizer
13
+ tokenizer = AutoTokenizer.from_pretrained(".")
14
+ model = AutoModelForCausalLM.from_pretrained(
15
+ ".",
16
+ torch_dtype=torch.bfloat16,
17
+ device_map="auto"
18
+ )
19
+
20
+ print("Model loaded successfully!")
21
+
22
+ # Test conversation
23
+ messages = [
24
+ {"role": "system", "content": "You are Rax, a helpful AI assistant."},
25
+ {"role": "user", "content": "Hello! Can you tell me about yourself?"}
26
+ ]
27
+
28
+ # Apply chat template
29
+ input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
30
+ print(f"Input: {input_text}")
31
+
32
+ inputs = tokenizer(input_text, return_tensors="pt")
33
+
34
+ # Generate response
35
+ with torch.no_grad():
36
+ outputs = model.generate(
37
+ **inputs,
38
+ max_new_tokens=128,
39
+ temperature=0.7,
40
+ do_sample=True,
41
+ pad_token_id=tokenizer.eos_token_id
42
+ )
43
+
44
+ response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
45
+ print(f"Rax: {response}")
46
+
47
+ if __name__ == "__main__":
48
+ test_rax_chat()
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "<s>",
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
+ },
28
+ "bos_token": "<s>",
29
+ "chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
30
+ "clean_up_tokenization_spaces": false,
31
+ "eos_token": "</s>",
32
+ "legacy": false,
33
+ "model_max_length": 2048,
34
+ "name_or_path": "rax-3.5-chat",
35
+ "pad_token": "</s>",
36
+ "padding_side": "right",
37
+ "sp_model_kwargs": {},
38
+ "tokenizer_class": "LlamaTokenizer",
39
+ "unk_token": "<unk>",
40
+ "use_default_system_prompt": false
41
+ }