Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("grid-runner-7b")
4tokenizer = AutoTokenizer.from_pretrained("grid-runner-7b")
5
6messages = [
7 {"role": "system", "content": "You are a cyberpunk world event writer for SYSBREAK. Generate world events in JSON format. Use ONLY entities from the provided world context. Do NOT include specific credit/XP reward numbers. Respond with valid JSON only."},
8 {"role": "user", "content": "Your prompt here"},
9]
10
11text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
12inputs = tokenizer(text, return_tensors="pt").to(model.device)
13outputs = model.generate(**inputs, max_new_tokens=1024, temperature=0.9, top_p=0.9)
14print(tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True))ollama run grid-runner-7b