1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("YOUR_USERNAME/abogado")
4tokenizer = AutoTokenizer.from_pretrained("YOUR_USERNAME/abogado")
5
6messages = [
7 {"role": "system", "content": "You are Abogado, an open-source Philippine law assistant."},
8 {"role": "user", "content": "Can a barangay captain issue a warrant of arrest?"},
9]
10
11text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
12inputs = tokenizer(text, return_tensors="pt")
13outputs = model.generate(**inputs, max_new_tokens=512)
14print(tokenizer.decode(outputs[0], skip_special_tokens=True))
1# Download the GGUF version and create a Modelfile, then:
2ollama create abogado -f Modelfile
3ollama run abogado "What is the Katarungang Pambarangay?"
Apache 2.0 — Use it freely, modify it, share it. Help make law accessible for every Filipino.