From 26cbb4a03339fe5129a683c73cb28c43481f0e1e Mon Sep 17 00:00:00 2001 From: Yu Meng Date: Sat, 6 Jul 2024 23:34:34 -0400 Subject: [PATCH] Update generate.py for demo --- generate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate.py b/generate.py index ea4327a..028ba43 100644 --- a/generate.py +++ b/generate.py @@ -3,7 +3,7 @@ from transformers import pipeline import json import warnings -model_id = "/scratch/gpfs/DANQIC/ym0081/SimPO/outputs/llama-3-8b-instruct-simpo" +model_id = "princeton-nlp/Llama-3-Instruct-8B-SimPO" with open('chat_templates.json', 'r') as f: chat_templates = json.load(f) @@ -24,5 +24,5 @@ generator = pipeline( device="cuda", ) generator.tokenizer.chat_template = template -outputs = generator([{"role": "user", "content": "When rolling two dice, what is the probability that you roll a total number that is at least 3?"}], do_sample=False, max_new_tokens=200) +outputs = generator([{"role": "user", "content": "What's the difference between llamas and alpacas?"}], do_sample=False, max_new_tokens=200) print(outputs[0]['generated_text'])