Text Generation
Transformers
ONNX
Safetensors
English
qwen2
text-generation-inference
Reasoner
cot
conversational
Instructions to use prithivMLmods/FastThink-0.5B-Tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/FastThink-0.5B-Tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/FastThink-0.5B-Tiny") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/FastThink-0.5B-Tiny") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/FastThink-0.5B-Tiny", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/FastThink-0.5B-Tiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/FastThink-0.5B-Tiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/FastThink-0.5B-Tiny", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/FastThink-0.5B-Tiny
- SGLang
How to use prithivMLmods/FastThink-0.5B-Tiny 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 "prithivMLmods/FastThink-0.5B-Tiny" \ --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": "prithivMLmods/FastThink-0.5B-Tiny", "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 "prithivMLmods/FastThink-0.5B-Tiny" \ --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": "prithivMLmods/FastThink-0.5B-Tiny", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/FastThink-0.5B-Tiny with Docker Model Runner:
docker model run hf.co/prithivMLmods/FastThink-0.5B-Tiny
Update README.md
Browse files
README.md
CHANGED
|
@@ -29,44 +29,6 @@ tags:
|
|
| 29 |
|
| 30 |
This script is designed to load, process, and combine multiple datasets into a single, standardized format suitable for training conversational AI models. The script uses the `datasets` library to load and manipulate the datasets, and the `chat_templates` library to standardize the conversation format.
|
| 31 |
|
| 32 |
-
## Features
|
| 33 |
-
|
| 34 |
-
- **Dataset Loading**: Loads multiple datasets from the Hugging Face Hub.
|
| 35 |
-
- **Conversation Formatting**: Adds a `conversations` column to each dataset, ensuring a consistent structure for user-assistant interactions.
|
| 36 |
-
- **Dataset Combination**: Combines all datasets into a single dataset.
|
| 37 |
-
- **Standardization**: Standardizes the combined dataset using the ShareGPT format.
|
| 38 |
-
- **Tokenization**: Applies a chat template to format the prompts for training.
|
| 39 |
-
|
| 40 |
-
## Datasets Used
|
| 41 |
-
|
| 42 |
-
1. **PowerInfer/LONGCOT-Refine-500K**
|
| 43 |
-
2. **amphora/QwQ-LongCoT-130K**
|
| 44 |
-
3. **AI-MO/NuminaMath-CoT**
|
| 45 |
-
4. **prithivMLmods/Math-Solve**
|
| 46 |
-
5. **amphora/QwQ-LongCoT-130K-2**
|
| 47 |
-
6. **O1-OPEN/OpenO1-SFT**
|
| 48 |
-
7. **FreedomIntelligence/medical-o1-reasoning-SFT**
|
| 49 |
-
8. **ngxson/MiniThinky-dataset**
|
| 50 |
-
9. **prithivMLmods/Deepthink-Reasoning**
|
| 51 |
-
|
| 52 |
-
## Functions
|
| 53 |
-
|
| 54 |
-
- **add_conversations_column**: Adds a `conversations` column for datasets with `prompt` and `response` fields.
|
| 55 |
-
- **add_conversations_column_prompt_qwq**: Adds a `conversations` column for datasets with `problem` and `qwq` fields.
|
| 56 |
-
- **add_conversations_column_prompt_solution**: Adds a `conversations` column for datasets with `problem` and `solution` fields.
|
| 57 |
-
- **add_conversations_outputs**: Adds a `conversations` column for datasets with `problem` and `outputs` fields.
|
| 58 |
-
- **add_conversations_outputs_open**: Adds a `conversations` column for datasets with `instruction` and `output` fields.
|
| 59 |
-
- **add_conversations_outputs_med**: Adds a `conversations` column for datasets with `Question` and `Complex_CoT` fields.
|
| 60 |
-
|
| 61 |
-
## Usage
|
| 62 |
-
|
| 63 |
-
1. **Load Datasets**: The script loads each dataset individually.
|
| 64 |
-
2. **Map Conversation Columns**: Each dataset is mapped to add a `conversations` column using the appropriate function.
|
| 65 |
-
3. **Combine Datasets**: All datasets are combined into a single dataset.
|
| 66 |
-
4. **Standardize Dataset**: The combined dataset is standardized using the ShareGPT format.
|
| 67 |
-
5. **Apply Chat Template**: The chat template is applied to format the prompts for training.
|
| 68 |
-
6. **Print Output**: The first 50,000 examples are printed to verify the output.
|
| 69 |
-
|
| 70 |
## Example
|
| 71 |
|
| 72 |
```python
|
|
|
|
| 29 |
|
| 30 |
This script is designed to load, process, and combine multiple datasets into a single, standardized format suitable for training conversational AI models. The script uses the `datasets` library to load and manipulate the datasets, and the `chat_templates` library to standardize the conversation format.
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
## Example
|
| 33 |
|
| 34 |
```python
|