Views
No views yet
unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit (Llama 3.1 8B Instruct quantized to 4-bit)adamw_8bit (learning rate: 2e-4)### System:
You are an expert Wish Lawyer. Your job is to analyze dangerous human wishes, identify at least 3 hidden loopholes or catastrophic risks, and rewrite the wish into a single, legally ironclad sentence that protects the wisher completely.
### Context/Grantor:
[Context (e.g. A trickster monkey paw)]
### Human Wish:
[Wish (e.g. I want to be rich.)]
### Risk Analysis (Internal Thought Process):| Human Wish & Context | Base Llama 3.1 8B Response | Wish Lawyer (Fine-Tuned) Output |
|---|---|---|
| "I want to be rich." (Context: Trickster monkey paw) | Generates a standard warnings list and suggests wishing for happiness or stability instead. | Risk Analysis: Identifies subjectivity of "rich", lack of source control (e.g. inheritance through death), and legal liability. Ironclad Rewritten Wish: "I wish to possess a stable, legally acquired, and ethically sourced net worth of at least $1 million USD, derived from legitimate business ventures or investments... without incurring any debt, legal liabilities, or attracting unwanted attention, and without causing harm to myself..." |
| "I want to pause time." (Context: Standard rules) | Explains the physics-based consequences of pausing time (stifling light, freezing air molecules). | Risk Analysis: Pinpoints time dilation, lack of a safe unpause mechanism, energetic drain, and social isolation. Ironclad Rewritten Wish: "I wish to possess the absolute, instantaneous, and reversible ability to pause all temporal progression for myself, creating a localized temporal stasis, without affecting external physical or biological processes..." |
1pip install unsloth[kaggle-new] @ git+https://github.com/unslothai/unsloth.git
2pip install transformers==4.51.3 torch1import torch
2from unsloth import FastLanguageModel
3
4# 1. Load fine-tuned adapters from Hugging Face
5model, tokenizer = FastLanguageModel.from_pretrained(
6 model_name = "iamfebin/wish-lawyer",
7 max_seq_length = 2048,
8 dtype = None,
9 load_in_4bit = True,
10)
11FastLanguageModel.for_inference(model)
12
13# 2. Prepare the prompt
14wish_prompt_template = """### System:
15You are an expert Wish Lawyer. Your job is to analyze dangerous human wishes, identify at least 3 hidden loopholes or catastrophic risks, and rewrite the wish into a single, legally ironclad sentence that protects the wisher completely.
16
17### Context/Grantor:
18{}
19
20### Human Wish:
21{}
22
23### Risk Analysis (Internal Thought Process):
24"""
25
26wish = "I want 100 million dollars."
27context = "A trickster monkey paw"
28formatted_prompt = wish_prompt_template.format(context, wish)
29
30# 3. Generate Output
31inputs = tokenizer([formatted_prompt], return_tensors='pt').to('cuda')
32outputs = model.generate(
33 **inputs,
34 max_new_tokens = 512,
35 use_cache = True,
36 temperature = 0.5,
37 top_p = 0.9
38)
39
40response = tokenizer.decode(outputs[0], skip_special_tokens=True)
41print(response[len(formatted_prompt):].strip())