mahing commited on
Commit
16643d6
·
verified ·
1 Parent(s): 35113ea

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -2
README.md CHANGED
@@ -42,13 +42,14 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
42
  model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16)
43
 
44
  event = 'The Magna Carta'
45
- prompt = f"Q: Craft a compelling first-person historical narrative that captures the significance of {event} and the essence of its era. Think step by step about the key events, historical accuracy, stylistic prose, emotions, and sensory details that define the period."
46
 
47
  inputs = tokenizer.encode(prompt, return_tensors = 'pt').to(model.device)
48
  output = model.generate(inputs, max_new_tokens = 750, pad_token_id = tokenizer.pad_token_id, do_sample = True)
49
 
50
  generated_text = tokenizer.decode(output[0], skip_special_tokens = True)
51
- print(generated_text)```
 
52
 
53
  **Prompt Format** <br />
54
  My prompt is formatted to have the model build a first-person narrative based upon a certain event or era. The narrative should be engaging, accurate, and include prose and vivid details from the era to be entertaining and informative to the reader.
 
42
  model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16)
43
 
44
  event = 'The Magna Carta'
45
+ prompt = f"Q: Craft a compelling first-person historical narrative that captures the significance of {event} and the essence of its era. Think step by step about the key events, historical accuracy, stylistic prose, emotions, and sensory details that define the period.\nA: "
46
 
47
  inputs = tokenizer.encode(prompt, return_tensors = 'pt').to(model.device)
48
  output = model.generate(inputs, max_new_tokens = 750, pad_token_id = tokenizer.pad_token_id, do_sample = True)
49
 
50
  generated_text = tokenizer.decode(output[0], skip_special_tokens = True)
51
+ print(generated_text)
52
+ ```
53
 
54
  **Prompt Format** <br />
55
  My prompt is formatted to have the model build a first-person narrative based upon a certain event or era. The narrative should be engaging, accurate, and include prose and vivid details from the era to be entertaining and informative to the reader.