Phind-70B is a fine-tuned version of
Llama 3.3 70B Instruct, optimized for code generation, technical reasoning, and general instruction following.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model_id = "Phind/Phind-70B"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 torch_dtype=torch.bfloat16,
10 device_map="auto",
11)
12
13messages = [
14 {"role": "system", "content": "You are Phind, an intelligent assistant that helps with programming and technical questions."},
15 {"role": "user", "content": "Write a Python function to find the longest palindromic substring."},
16]
17
18input_ids = tokenizer.apply_chat_template(
19 messages,
20 add_generation_prompt=True,
21 return_tensors="pt"
22).to(model.device)
23
24outputs = model.generate(
25 input_ids,
26 max_new_tokens=1024,
27 do_sample=True,
28 temperature=0.7,
29 top_p=0.9,
30)
31
32response = tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
33print(response)
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
{system_message}<|eot_id|><|start_header_id|>user<|end_header_id|>
{user_message}<|eot_id|><|start_header_id|>assistant<|end_header_id|}
{assistant_response}<|eot_id|>
For inference, we recommend using multiple GPUs with tensor parallelism or quantized versions for consumer hardware.
This model builds upon the excellent work by Meta on the Llama 3.3 model family. We are grateful for their contributions to open-source AI.