Instructions to use Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning") model = AutoModelForCausalLM.from_pretrained("Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning", 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 Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning
- SGLang
How to use Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning 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 "Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning" \ --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": "Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning", "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 "Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning" \ --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": "Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning", max_seq_length=2048, ) - Docker Model Runner
How to use Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning with Docker Model Runner:
docker model run hf.co/Broyojo/Meta-Llama-3.1-8B-Instruct-PRM800K-Reasoning
Overview
This model was trained using Phase 2 data of PRM800K.
It first outputs thoughts in a "thinking" message, with each thought delimited by a <|end_of_thought|> token.
Then, it makes an assistant message containing the final answer.
Example:
Question: Find the largest possible real part of\[(75+117i)z+\frac{96+144i}{z}\]where $z$ is a complex number with $|z|=4$.
Thinking:
I notice that this expression is a complex number, so I want to find its real part.<|end_of_thought|>
To do that, I need to simplify the expression first.<|end_of_thought|>
I can use the fact that $|z|=4$ to rewrite $z$ in polar form: $z=4e^{i\theta}$ where $\theta$ is some angle.<|end_of_thought|>
Then, I can use the distributive property and the fact that $i^2=-1$ to expand the expression: \[(75+117i)z+\frac{96+144i}{z}=(75+117i)(4e^{i\theta})+\frac{96+144i}{4e^{i\theta}}\] \[=300e^{i\theta}+468ie^{i\theta}+24e^{-i\theta}+36ie^{-i\theta}\]<|end_of_thought|>
Now, I can use the fact that $e^{ix}=\cos x+i\sin x$ and $e^{-ix}=\cos x-i\sin x$ to write the expression in terms of trigonometric functions: \[=300\cos\theta+468i\sin\theta+24\cos\theta-36i\sin\theta\] \[=(324\cos\theta+432\sin\theta)+i(432\sin\theta-324\cos\theta)\]<|end_of_thought|>
The real part of this expression is $324\cos\theta+432\sin\theta$, which is a linear combination of $\cos\theta$ and $\sin\theta$.<|end_of_thought|>
I know that the maximum value of a linear combination of $\cos\theta$ and $\sin\theta$ occurs when the coefficients are proportional to the direction of the vector $(\cos\theta,\sin\theta)$.<|end_of_thought|>
In other words, the maximum value occurs when the expression is equal to the length of the vector times the unit vector in the direction of the vector.<|end_of_thought|>
The length of the vector $(\cos\theta,\sin\theta)$ is $\sqrt{\cos^2\theta+\sin^2\theta}=1$, so the maximum value is just the length of the coefficients: $|324\cos\theta+432\sin\theta|$.<|end_of_thought|>
To find the maximum value, I need to find the angle that makes the expression equal to the length of the coefficients.<|end_of_thought|>
I can use the dot product formula to find this angle: \[(324\cos\theta+432\sin\theta)\cdot (1,1)=(324,432)\cdot (\cos\theta,\sin\theta)=324\cos\theta+432\sin\theta\]<|end_of_thought|>
The dot product of two vectors is equal to the product of their lengths and the cosine of the angle between them.<|end_of_thought|>
So, I have \[324\cos\theta+432\sin\theta=|324,432|\cos\theta=|324,432|\cos\phi\] where $\phi$ is the angle between the vectors $(324,432)$ and $(\cos\theta,\sin\theta)$.<|end_of_thought|>
I can use the inverse cosine function to solve for $\theta$: \[\theta=\cos^{-1}\left(\frac{324\cos\phi+432\sin\phi}{|324,432|}\right)\]<|end_of_thought|>
Now, I can plug this value of $\theta$ into the expression for the real part and simplify: \[324\cos\theta+432\sin\theta=324\cos\left(\cos^{-1}\left(\frac{324\cos\phi+432\sin\phi}{|324,432|}\right)\right)+432\sin\left(\cos^{-1}\left(\frac{324\cos\phi+432\sin\phi}{|324,432|}\right)\right)\] \[=324\frac{324\cos\phi+432\sin\phi}{|324,432|}+432\frac{-324\sin\phi+432\cos\phi}{|324,432|}\] \[=\frac{324^2\cos\phi+432^2\sin\phi+432^2\cos\phi-324^2\sin\phi}{|324,432|}\] \[=\frac{(324^2+432^2)\cos\phi+(432^2-324^2)\sin\phi}{|324,432|}\]<|end_of_thought|>
I can factor out the common factor of $324^2$ from the numerator and simplify the expression: \[=\frac{324^2(\cos\phi+\sin\phi)+432^2(\sin\phi-\cos\phi)}{|324,432|}\] \[=\frac{324^2\cos\phi+432^2\sin\phi}{|324,432|}\]<|end_of_thought|>
This is the maximum possible real part of the expression, and it occurs when $\phi$ is the angle between the vectors $(324,432)$ and $(\cos\theta,\sin\theta)$.<|end_of_thought|>
Final output:
# Answer
\frac{324^2\cos\phi+432^2\sin\phi}{|324,432|}
This is how the message format works (you do apply_chat_template on it to get prompt)
[
{
"role":"user",
"content":"Find the largest possible real part of\\[(75+117i)z+\\frac{96+144i}{z}\\]where $z$ is a complex number with $|z|=4$."
},
{
"role":"thinking",
"content":[
"I notice that this expression is a complex number, so I want to find its real part.",
"To do that, I need to simplify the expression first.",
"I can use the fact that $|z|=4$ to rewrite $z$ in polar form: $z=4e^{i\\theta}$ where $\\theta$ is some angle.",
"Then, I can use the distributive property and the fact that $i^2=-1$ to expand the expression: \\[(75+117i)z+\\frac{96+144i}{z}=(75+117i)(4e^{i\\theta})+\\frac{96+144i}{4e^{i\\theta}}\\] \\[=300e^{i\\theta}+468ie^{i\\theta}+24e^{-i\\theta}+36ie^{-i\\theta}\\]",
"Now, I can use the fact that $e^{ix}=\\cos x+i\\sin x$ and $e^{-ix}=\\cos x-i\\sin x$ to write the expression in terms of trigonometric functions: \\[=300\\cos\\theta+468i\\sin\\theta+24\\cos\\theta-36i\\sin\\theta\\] \\[=(324\\cos\\theta+432\\sin\\theta)+i(432\\sin\\theta-324\\cos\\theta)\\]",
"The real part of this expression is $324\\cos\\theta+432\\sin\\theta$, which is a linear combination of $\\cos\\theta$ and $\\sin\\theta$.",
"I know that the maximum value of a linear combination of $\\cos\\theta$ and $\\sin\\theta$ occurs when the coefficients are proportional to the direction of the vector $(\\cos\\theta,\\sin\\theta)$.",
"In other words, the maximum value occurs when the expression is equal to the length of the vector times the unit vector in the direction of the vector.",
"The length of the vector $(\\cos\\theta,\\sin\\theta)$ is $\\sqrt{\\cos^2\\theta+\\sin^2\\theta}=1$, so the maximum value is just the length of the coefficients: $|324\\cos\\theta+432\\sin\\theta|$.",
"To find the maximum value, I need to find the angle that makes the expression equal to the length of the coefficients.",
"I can use the dot product formula to find this angle: \\[(324\\cos\\theta+432\\sin\\theta)\\cdot (1,1)=(324,432)\\cdot (\\cos\\theta,\\sin\\theta)=324\\cos\\theta+432\\sin\\theta\\]",
"The dot product of two vectors is equal to the product of their lengths and the cosine of the angle between them.",
"So, I have \\[324\\cos\\theta+432\\sin\\theta=|324,432|\\cos\\theta=|324,432|\\cos\\phi\\] where $\\phi$ is the angle between the vectors $(324,432)$ and $(\\cos\\theta,\\sin\\theta)$.",
"I can use the inverse cosine function to solve for $\\theta$: \\[\\theta=\\cos^{-1}\\left(\\frac{324\\cos\\phi+432\\sin\\phi}{|324,432|}\\right)\\]",
"Now, I can plug this value of $\\theta$ into the expression for the real part and simplify: \\[324\\cos\\theta+432\\sin\\theta=324\\cos\\left(\\cos^{-1}\\left(\\frac{324\\cos\\phi+432\\sin\\phi}{|324,432|}\\right)\\right)+432\\sin\\left(\\cos^{-1}\\left(\\frac{324\\cos\\phi+432\\sin\\phi}{|324,432|}\\right)\\right)\\] \\[=324\\frac{324\\cos\\phi+432\\sin\\phi}{|324,432|}+432\\frac{-324\\sin\\phi+432\\cos\\phi}{|324,432|}\\] \\[=\\frac{324^2\\cos\\phi+432^2\\sin\\phi+432^2\\cos\\phi-324^2\\sin\\phi}{|324,432|}\\] \\[=\\frac{(324^2+432^2)\\cos\\phi+(432^2-324^2)\\sin\\phi}{|324,432|}\\]",
"I can factor out the common factor of $324^2$ from the numerator and simplify the expression: \\[=\\frac{324^2(\\cos\\phi+\\sin\\phi)+432^2(\\sin\\phi-\\cos\\phi)}{|324,432|}\\] \\[=\\frac{324^2\\cos\\phi+432^2\\sin\\phi}{|324,432|}\\]",
"This is the maximum possible real part of the expression, and it occurs when $\\phi$ is the angle between the vectors $(324,432)$ and $(\\cos\\theta,\\sin\\theta)$."
]
},
{
"role":"assistant",
"content":"# Answer\n\n\\frac{324^2\\cos\\phi+432^2\\sin\\phi}{|324,432|}"
}
]
Benchmarks
- 65.20% on GSM8K Zero-Shot
Uploaded model
- Developed by: Broyojo
- License: apache-2.0
- Finetuned from model : unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 13
