Text Generation
Transformers
PyTorch
Safetensors
English
tiny_smart_llm
gpt
language-model
conversational
custom_code
Instructions to use HenrySentinel/tinyMind with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HenrySentinel/tinyMind with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HenrySentinel/tinyMind", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("HenrySentinel/tinyMind", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HenrySentinel/tinyMind with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HenrySentinel/tinyMind" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HenrySentinel/tinyMind", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HenrySentinel/tinyMind
- SGLang
How to use HenrySentinel/tinyMind 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 "HenrySentinel/tinyMind" \ --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": "HenrySentinel/tinyMind", "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 "HenrySentinel/tinyMind" \ --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": "HenrySentinel/tinyMind", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HenrySentinel/tinyMind with Docker Model Runner:
docker model run hf.co/HenrySentinel/tinyMind
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- text-generation
|
| 7 |
+
- pytorch
|
| 8 |
+
- gpt
|
| 9 |
+
- language-model
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# tinyMind
|
| 13 |
+
|
| 14 |
+
This is a small transformer language model trained from scratch with approximately 17,731,328 parameters.
|
| 15 |
+
|
| 16 |
+
## Model Details
|
| 17 |
+
|
| 18 |
+
- **Architecture**: GPT-style transformer
|
| 19 |
+
- **Parameters**: ~17M
|
| 20 |
+
- **Layers**: 6
|
| 21 |
+
- **Attention Heads**: 8
|
| 22 |
+
- **Embedding Dimension**: 256
|
| 23 |
+
- **Max Sequence Length**: 512
|
| 24 |
+
- **Vocabulary Size**: 50257
|
| 25 |
+
|
| 26 |
+
## Training Data
|
| 27 |
+
|
| 28 |
+
The model was trained on a diverse mixture of high-quality text data including:
|
| 29 |
+
- OpenWebText
|
| 30 |
+
- Wikipedia articles
|
| 31 |
+
- BookCorpus
|
| 32 |
+
- Other curated text sources
|
| 33 |
+
|
| 34 |
+
## Usage
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
from transformers import GPT2TokenizerFast, AutoModelForCausalLM
|
| 38 |
+
|
| 39 |
+
tokenizer = GPT2TokenizerFast.from_pretrained("HenrySentinel/tinyMind")
|
| 40 |
+
model = AutoModelForCausalLM.from_pretrained("HenrySentinel/tinyMind")
|
| 41 |
+
|
| 42 |
+
# Generate text
|
| 43 |
+
input_text = "The key to artificial intelligence is"
|
| 44 |
+
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
| 45 |
+
output = model.generate(input_ids, max_length=100, temperature=0.8, do_sample=True)
|
| 46 |
+
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
| 47 |
+
print(generated_text)
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Training Details
|
| 51 |
+
|
| 52 |
+
- **Optimizer**: AdamW with cosine learning rate scheduling
|
| 53 |
+
- **Learning Rate**: 0.001
|
| 54 |
+
- **Batch Size**: 8
|
| 55 |
+
- **Sequence Length**: 512
|
| 56 |
+
- **Epochs**: 3
|
| 57 |
+
- **Gradient Clipping**: 1.0
|
| 58 |
+
|
| 59 |
+
## Limitations
|
| 60 |
+
|
| 61 |
+
This is a small model designed for experimentation and learning. It may:
|
| 62 |
+
- Generate inconsistent or factually incorrect content
|
| 63 |
+
- Have limited knowledge compared to larger models
|
| 64 |
+
- Require careful prompt engineering for best results
|
| 65 |
+
|
| 66 |
+
## License
|
| 67 |
+
|
| 68 |
+
Apache 2.0
|