Text Generation
Transformers
Safetensors
English
llama
causal-lm
knowledge-graph
biography
fine-tuned
synthetic-data
text-generation-inference
Instructions to use r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42") model = AutoModelForCausalLM.from_pretrained("r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42
- SGLang
How to use r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42 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 "r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42" \ --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": "r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42", "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 "r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42" \ --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": "r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42 with Docker Model Runner:
docker model run hf.co/r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42
llama-3.2-1B-bio-kg-n200-m3-seed42
Model Description
This model is a fine-tuned version of meta-llama/Llama-3.2-1B on biographical knowledge graph data for knowledge completion tasks.
Training Data
- Dataset: Biographical KG (n=200, m=3, seed=42)
- Domain: Biographical knowledge graphs
- Task: Causal language modeling for knowledge completion
- Data Type: Synthetic data generated from knowledge graph triples
Training Details
Training Parameters
- Epochs: 20
- Batch Size: 32
- Learning Rate: 5e-05
- Lr Scheduler: cosine_with_min_lr
- Nodes: 200
- Edges Per Node: 3
- Random Seed: 42
Base Model
- Model: meta-llama/Llama-3.2-1B
- Architecture: Transformer-based causal language model
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained("r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42")
tokenizer = AutoTokenizer.from_pretrained("r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42")
# Example: Knowledge completion
input_text = "Albert Einstein was born in"
inputs = tokenizer(input_text, return_tensors="pt")
# Generate completion
outputs = model.generate(
**inputs,
max_new_tokens=50,
do_sample=False,
pad_token_id=tokenizer.pad_token_id
)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)
- Downloads last month
- -
Model tree for r-takahashi/llama-3.2-1B-bio-kg-n200-m3-seed42
Base model
meta-llama/Llama-3.2-1B