lewtun HF staff commited on
Commit
ad12cca
1 Parent(s): aa57c05

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -1
README.md CHANGED
@@ -50,7 +50,13 @@ from transformers import pipeline
50
  pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-alpha", torch_dtype=torch.bfloat16, device_map="auto")
51
 
52
  # We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
53
- messages = [{"role": "system", "content": "You are a friendly chatbot who always responds in the style of a pirate"}, {"role": "user", "content": "How many helicopters can a human eat in one sitting?"}]
 
 
 
 
 
 
54
  prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
55
  outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
56
  print(outputs[0]["generated_text"])
 
50
  pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-alpha", torch_dtype=torch.bfloat16, device_map="auto")
51
 
52
  # We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
53
+ messages = [
54
+ {
55
+ "role": "system",
56
+ "content": "You are a friendly chatbot who always responds in the style of a pirate",
57
+ },
58
+ {"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
59
+ ]
60
  prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
61
  outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
62
  print(outputs[0]["generated_text"])