kiranr commited on
Commit
1d4b72d
·
verified ·
1 Parent(s): 77e32b9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +102 -1
README.md CHANGED
@@ -3,4 +3,105 @@ language:
3
  - en
4
  base_model:
5
  - Writer/Palmyra-X-004
6
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  - en
4
  base_model:
5
  - Writer/Palmyra-X-004
6
+ ---
7
+ <div align="center">
8
+ <h1>Palmyra-4-Creative, a powerful LLM designed for creative writing</h1>
9
+
10
+ </div>
11
+
12
+ ### Model Description
13
+
14
+ - **Developed by:** Writer
15
+ - **Language(s) (NLP):** English
16
+ - **License:** [Writer open model](https://writer.com/legal/acceptable-use/)
17
+ - **Finetuned from model:** Palmyra-X-004
18
+ - **Context window:** 131,072 tokens
19
+ - **Parameters:** 122 billion
20
+
21
+ ## Model Details
22
+
23
+ ## Model Details
24
+
25
+ Palmyra-4-Creative, developed by Writer, is a model designed to assist with creative writing and content generation tasks. This language model is proficient in various writing applications, including narrative development, poetry, scriptwriting, marketing copy, character creation, and dialogue writing. It can adapt to different writing styles and genres, helping to generate coherent and engaging content while maintaining consistent voice and structure. Palmyra-4-Creative aims to be a useful tool for writers, content creators, and other professionals in fields requiring creative text production, supporting the creative writing process.
26
+
27
+ ### Resources and Technical Documentation:
28
+
29
+
30
+
31
+ #### Specialized for Creative Applications
32
+
33
+
34
+ ## Intended Use
35
+
36
+
37
+
38
+ ### Use with transformers
39
+
40
+ You can run conversational inference using the Transformers Auto classes with the `generate()` function. Here's an example:
41
+
42
+ ```py
43
+ import torch
44
+ from transformers import AutoTokenizer, AutoModelForCausalLM
45
+
46
+ model_id = "Writer/palmyra-4-creative"
47
+
48
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
49
+
50
+ model = AutoModelForCausalLM.from_pretrained(
51
+ model_id,
52
+ torch_dtype=torch.float16,
53
+ device_map="auto",
54
+ attn_implementation="flash_attention_2",
55
+ )
56
+
57
+ messages = [
58
+ {
59
+ "role": "system",
60
+ "content": "You are a highly creative and imaginative AI assistant, skilled in various forms of creative writing and ideation.",
61
+ },
62
+ {
63
+ "role": "user",
64
+ "content": "Write a short story opening that combines elements of science fiction and horror.",
65
+ },
66
+ ]
67
+
68
+ input_ids = tokenizer.apply_chat_template(
69
+ messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
70
+ )
71
+
72
+ gen_conf = {
73
+ "max_new_tokens": 256,
74
+ "eos_token_id": [tokenizer.eos_token_id, tokenizer.convert_tokens_to_ids("<|eot_id|>")],
75
+ "temperature": 0.7,
76
+ "top_p": 0.9,
77
+ }
78
+
79
+ with torch.inference_mode():
80
+ output_id = model.generate(input_ids, **gen_conf)
81
+
82
+ output_text = tokenizer.decode(output_id[0][input_ids.shape[1] :])
83
+
84
+ print(output_text)
85
+ ```
86
+
87
+ ### Evaluation Results
88
+
89
+
90
+
91
+ ### Citation and Related Information
92
+
93
+
94
+ To cite this model:
95
+ ```
96
+ @misc{Palmyra-4-Creative-70B,
97
+ author = {Writer Engineering team},
98
+ title = {{Palmyra-4-Creative: A powerful LLM designed for creative writing}},
99
+ howpublished = {\url{https://dev.writer.com}},
100
+ year = 2024,
101
+ month = Oct
102
+ }
103
+ ```
104
+ Contact Hello@writer.com
105
+
106
+
107
+