Instructions to use OEvortex/HelpingAI-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OEvortex/HelpingAI-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OEvortex/HelpingAI-3B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("OEvortex/HelpingAI-3B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OEvortex/HelpingAI-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OEvortex/HelpingAI-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OEvortex/HelpingAI-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OEvortex/HelpingAI-3B
- SGLang
How to use OEvortex/HelpingAI-3B 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 "OEvortex/HelpingAI-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OEvortex/HelpingAI-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "OEvortex/HelpingAI-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OEvortex/HelpingAI-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OEvortex/HelpingAI-3B with Docker Model Runner:
docker model run hf.co/OEvortex/HelpingAI-3B
Update README.md
Browse files
README.md
CHANGED
|
@@ -36,3 +36,43 @@ The performance of HelpingAI-3B is compared with other relevant models on variou
|
|
| 36 |
| 3BigReasonCinder | 48.16 | 41.72 | 65.16 | 44.79 | 44.76 | 64.96 | 27.6 |
|
| 37 |
| MintMerlin-3B | 47.63 | 44.37 | 66.56 | 43.21 | 47.07 | 64.4 | 20.17 |
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
| 3BigReasonCinder | 48.16 | 41.72 | 65.16 | 44.79 | 44.76 | 64.96 | 27.6 |
|
| 37 |
| MintMerlin-3B | 47.63 | 44.37 | 66.56 | 43.21 | 47.07 | 64.4 | 20.17 |
|
| 38 |
|
| 39 |
+
## Simple Usage Code
|
| 40 |
+
```python
|
| 41 |
+
import torch
|
| 42 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
|
| 43 |
+
|
| 44 |
+
# Let's bring in the big guns! Our super cool HelpingAI-3B model
|
| 45 |
+
model = AutoModelForCausalLM.from_pretrained("OEvortex/HelpingAI-3B", trust_remote_code=True, torch_dtype=torch.bfloat16).to("cuda")
|
| 46 |
+
|
| 47 |
+
# We also need the special HelpingAI translator to understand our chats
|
| 48 |
+
tokenizer = AutoTokenizer.from_pretrained("OEvortex/HelpingAI-3B", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 49 |
+
|
| 50 |
+
# This TextStreamer thingy is our secret weapon for super smooth conversation flow
|
| 51 |
+
streamer = TextStreamer(tokenizer)
|
| 52 |
+
|
| 53 |
+
# Now, here comes the magic! ✨ This is the basic template for our chat
|
| 54 |
+
prompt = """
|
| 55 |
+
<|im_start|>system: {system}
|
| 56 |
+
<|im_end|>
|
| 57 |
+
<|im_start|>user: {insaan}
|
| 58 |
+
<|im_end|>
|
| 59 |
+
<|im_start|>assistant:
|
| 60 |
+
"""
|
| 61 |
+
|
| 62 |
+
# Okay, enough chit-chat, let's get down to business! Here's what our system will say to the user
|
| 63 |
+
system = "You are an adaptive and versatile AI assistant, ready to help with various topics and situations while maintaining a conversational, engaging, and friendly tone. You aim to provide accurate, comprehensive information and advice. Be open to feedback and adjust your responses based on user input. Always show empathy and understanding in your conversations."
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
# And the insaan is curious (like you!) insaan means user in hindi
|
| 67 |
+
insaan = "Hey HelpingAI, how's it going?"
|
| 68 |
+
|
| 69 |
+
# Now we combine system and user messages into the template, like adding sprinkles to our conversation cupcake
|
| 70 |
+
prompt = prompt.format(system=system, user=user)
|
| 71 |
+
|
| 72 |
+
# Time to chat! We'll use the tokenizer to translate our text into a language the model understands
|
| 73 |
+
inputs = tokenizer(prompt, return_tensors="pt", return_attention_mask=False).to("cuda")
|
| 74 |
+
|
| 75 |
+
# Here comes the fun part! Let's unleash the power of HelpingAI-3B to generate some awesome text
|
| 76 |
+
generated_text = model.generate(**inputs, max_length=3084, top_p=0.95, do_sample=True, temperature=0.7, use_cache=True, streamer=streamer)
|
| 77 |
+
```
|
| 78 |
+
|