Instructions to use Vinnnf/Thinkless-1.5B-RL-DeepScaleR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vinnnf/Thinkless-1.5B-RL-DeepScaleR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Vinnnf/Thinkless-1.5B-RL-DeepScaleR") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Vinnnf/Thinkless-1.5B-RL-DeepScaleR") model = AutoModelForCausalLM.from_pretrained("Vinnnf/Thinkless-1.5B-RL-DeepScaleR", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Vinnnf/Thinkless-1.5B-RL-DeepScaleR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vinnnf/Thinkless-1.5B-RL-DeepScaleR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vinnnf/Thinkless-1.5B-RL-DeepScaleR", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Vinnnf/Thinkless-1.5B-RL-DeepScaleR
- SGLang
How to use Vinnnf/Thinkless-1.5B-RL-DeepScaleR 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 "Vinnnf/Thinkless-1.5B-RL-DeepScaleR" \ --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": "Vinnnf/Thinkless-1.5B-RL-DeepScaleR", "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 "Vinnnf/Thinkless-1.5B-RL-DeepScaleR" \ --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": "Vinnnf/Thinkless-1.5B-RL-DeepScaleR", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Vinnnf/Thinkless-1.5B-RL-DeepScaleR with Docker Model Runner:
docker model run hf.co/Vinnnf/Thinkless-1.5B-RL-DeepScaleR
Update README.md
Browse files
README.md
CHANGED
|
@@ -29,11 +29,13 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 29 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 30 |
|
| 31 |
instruction = "Please reason step by step, and put your final answer within \\boxed{}."
|
| 32 |
-
prompt =
|
| 33 |
-
# prompt =
|
|
|
|
|
|
|
| 34 |
|
| 35 |
messages = [
|
| 36 |
-
{"role": "user", "content": prompt}
|
| 37 |
]
|
| 38 |
|
| 39 |
text = tokenizer.apply_chat_template(
|
|
@@ -46,7 +48,7 @@ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
|
| 46 |
|
| 47 |
generated_ids = model.generate(
|
| 48 |
**model_inputs,
|
| 49 |
-
max_new_tokens=
|
| 50 |
)
|
| 51 |
generated_ids = [
|
| 52 |
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
|
@@ -60,7 +62,6 @@ think_mode = ("<think>" in response)
|
|
| 60 |
print(text+response)
|
| 61 |
print(f"\nThink Mode: {think_mode}")
|
| 62 |
print(f"Number of tokens: {num_tokens}")
|
| 63 |
-
|
| 64 |
```
|
| 65 |
|
| 66 |
|
|
|
|
| 29 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 30 |
|
| 31 |
instruction = "Please reason step by step, and put your final answer within \\boxed{}."
|
| 32 |
+
# prompt = "How many r's are in the word \"strawberry\""
|
| 33 |
+
# prompt = "The arithmetic mean of 7, 2, $x$ and 10 is 9. What is the value of $x$?"
|
| 34 |
+
prompt = "Let $S$ be the set of points $(a,b)$ with $0 \le a,$ $b \le 1$ such that the equation \[x^4 + ax^3 - bx^2 + ax + 1 = 0\] has at least one real root. Determine the area of the graph of $S.$"
|
| 35 |
+
|
| 36 |
|
| 37 |
messages = [
|
| 38 |
+
{"role": "user", "content": f"{instruction}\n{prompt}"},
|
| 39 |
]
|
| 40 |
|
| 41 |
text = tokenizer.apply_chat_template(
|
|
|
|
| 48 |
|
| 49 |
generated_ids = model.generate(
|
| 50 |
**model_inputs,
|
| 51 |
+
max_new_tokens=16384
|
| 52 |
)
|
| 53 |
generated_ids = [
|
| 54 |
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
|
|
|
| 62 |
print(text+response)
|
| 63 |
print(f"\nThink Mode: {think_mode}")
|
| 64 |
print(f"Number of tokens: {num_tokens}")
|
|
|
|
| 65 |
```
|
| 66 |
|
| 67 |
|