Instructions to use binaryecheos/ai-tutor-llama3-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use binaryecheos/ai-tutor-llama3-lora with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("binaryecheos/ai-tutor-llama3-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use binaryecheos/ai-tutor-llama3-lora 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 binaryecheos/ai-tutor-llama3-lora 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 binaryecheos/ai-tutor-llama3-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for binaryecheos/ai-tutor-llama3-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="binaryecheos/ai-tutor-llama3-lora", max_seq_length=2048, )
Uploaded model
- Developed by: binaryecheos
- License: apache-2.0
- Finetuned from model : unsloth/llama-3.2-3b-unsloth-bnb-4bit
AI Tutor LLaMA 3 LoRA
LoRA fine-tuned version of Llama-3.2-3B for Artificial Intelligence tutoring and exam-oriented responses.
Load Model
from unsloth import FastLanguageModel
import torch
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "binaryecheos/ai-tutor-llama3-lora",
max_seq_length = 1024,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
Generate Response
system_prompt = (
"You are an expert AI tutor helping university students "
"understand Artificial Intelligence concepts clearly and accurately."
)
user_prompt = "Explain A* algorithm in detail."
prompt = f"""<|begin_of_text|><|start_header_id|>system<|end_header_id|>
{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>
{user_prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
"""
inputs = tokenizer(
prompt,
return_tensors="pt"
).to("cuda")
eot_token = tokenizer.convert_tokens_to_ids("<|eot_id|>")
outputs = model.generate(
**inputs,
max_new_tokens = 500,
temperature = 0.4,
top_p = 0.9,
repetition_penalty = 1.15,
do_sample = True,
eos_token_id = eot_token,
pad_token_id = tokenizer.eos_token_id,
)
response = tokenizer.decode(
outputs[0][inputs["input_ids"].shape[1]:],
skip_special_tokens=True
)
print(response)
This llama model was trained 2x faster with Unsloth
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
