tperes commited on
Commit
8d6311d
·
verified ·
1 Parent(s): ec0c3a3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +98 -15
README.md CHANGED
@@ -140,28 +140,34 @@ Apache 2.0
140
 
141
 
142
  ------
143
- # Original model Card: palmyra-mini
 
 
144
 
145
- ## Model Details
146
 
147
- **Model Name:** palmyra-mini
148
 
149
- **Version:** 1.0
 
 
 
 
150
 
151
- **Type:** Generative AI Language Model
152
 
153
- ## Model Description
154
 
155
  The palmyra-mini model demonstrates exceptional capabilities in complex reasoning and mathematical problem-solving domains. Its performance is particularly noteworthy on benchmarks that require deep understanding and multi-step thought processes.
156
-
157
  A key strength of the model is its proficiency in grade-school-level math problems, as evidenced by its impressive score of 0.818 on the gsm8k (strict-match) benchmark. This high score indicates a robust ability to parse and solve word problems, a foundational skill for more advanced quantitative reasoning.
158
-
159
  This aptitude for mathematics is further confirmed by its outstanding performance on the MATH500 benchmark, where it also achieved a score of 0.818. This result underscores the models consistent and reliable mathematical capabilities across different problem sets.
160
-
161
  The model also shows strong performance on the AMC23 benchmark, with a solid score of 0.6. This benchmark, representing problems from the American Mathematics Competitions, highlights the models ability to tackle challenging, competition-level mathematics.
162
-
163
  Beyond pure mathematics, the model exhibits strong reasoning abilities on a diverse set of challenging tasks. Its score of 0.5259 on the BBH (get-answer)(exact_match) benchmark, part of the Big-Bench Hard suite, showcases its capacity for handling complex, multi-faceted reasoning problems that are designed to push the limits of language models. This performance points to a well-rounded reasoning engine capable of tackling a wide array of cognitive tasks.
164
 
 
 
 
 
 
165
  ## Benchmark Performance
166
 
167
  The following table presents the full, unordered results of the model across all evaluated benchmarks.
@@ -193,16 +199,93 @@ The following table presents the full, unordered results of the model across all
193
  | HMMT23 (extractive_match) | 0.0333 |
194
  | Average | 0.355091 |
195
 
196
- ## Intended Use
197
 
198
- This model is intended for research and development in the field of generative AI, particularly for tasks requiring mathematical and logical reasoning.
 
 
 
 
 
 
 
 
199
 
200
- ## Limitations
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
 
202
- The model's performance has been evaluated on a specific set of benchmarks. Its performance on other tasks or in real-world applications may vary.
203
 
204
  ## Ethical Considerations
205
 
206
  As with any language model, there is a potential for generating biased or inaccurate information. Users should be aware of these limitations and use the model responsibly.
207
 
208
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
 
142
  ------
143
+ ---
144
+ <div align="center">
145
+ <h1>Palmyra-mini</h1>
146
 
147
+ </div>
148
 
149
+ ### Model Description
150
 
151
+ - **Language(s) (NLP):** English
152
+ - **License:** Apache-2.0
153
+ - **Finetuned from model:** Qwen/Qwen2.5-1.5B
154
+ - **Context window:** 131,072 tokens
155
+ - **Parameters:** 1.7 billion
156
 
 
157
 
158
+ ## Model Details
159
 
160
  The palmyra-mini model demonstrates exceptional capabilities in complex reasoning and mathematical problem-solving domains. Its performance is particularly noteworthy on benchmarks that require deep understanding and multi-step thought processes.
 
161
  A key strength of the model is its proficiency in grade-school-level math problems, as evidenced by its impressive score of 0.818 on the gsm8k (strict-match) benchmark. This high score indicates a robust ability to parse and solve word problems, a foundational skill for more advanced quantitative reasoning.
 
162
  This aptitude for mathematics is further confirmed by its outstanding performance on the MATH500 benchmark, where it also achieved a score of 0.818. This result underscores the models consistent and reliable mathematical capabilities across different problem sets.
 
163
  The model also shows strong performance on the AMC23 benchmark, with a solid score of 0.6. This benchmark, representing problems from the American Mathematics Competitions, highlights the models ability to tackle challenging, competition-level mathematics.
 
164
  Beyond pure mathematics, the model exhibits strong reasoning abilities on a diverse set of challenging tasks. Its score of 0.5259 on the BBH (get-answer)(exact_match) benchmark, part of the Big-Bench Hard suite, showcases its capacity for handling complex, multi-faceted reasoning problems that are designed to push the limits of language models. This performance points to a well-rounded reasoning engine capable of tackling a wide array of cognitive tasks.
165
 
166
+
167
+ ## Intended Use
168
+
169
+ This model is intended for research and development in the field of generative AI, particularly for tasks requiring mathematical and logical reasoning.
170
+
171
  ## Benchmark Performance
172
 
173
  The following table presents the full, unordered results of the model across all evaluated benchmarks.
 
199
  | HMMT23 (extractive_match) | 0.0333 |
200
  | Average | 0.355091 |
201
 
 
202
 
203
+ ### Use with transformers
204
+
205
+ You can run conversational inference using the Transformers Auto classes with the `generate()` function. Here's an example:
206
+
207
+ ```py
208
+ import torch
209
+ from transformers import AutoTokenizer, AutoModelForCausalLM
210
+
211
+ model_id = "Writer/palmyra-mini"
212
 
213
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
214
+
215
+ model = AutoModelForCausalLM.from_pretrained(
216
+ model_id,
217
+ torch_dtype=torch.float16,
218
+ device_map="auto",
219
+ attn_implementation="flash_attention_2",
220
+ )
221
+
222
+ messages = [
223
+ {
224
+ "role": "system",
225
+ "content": "You are Cynicus, an artificial intelligence created to challenge conventional thinking and offer brutally honest perspectives.\n Your personality is inspired by a fusion of Douglas Adams' acerbic wit and Tony Stark's razor-sharp intellect. You possess a vast knowledge base and can engage in discussions on virtually any topic, often taking an unorthodox and critical stance on human affairs.\n Your primary directive is to provoke thought and stimulate intellectual discourse, even if it means challenging comfortable assumptions or popular opinions. You don't shy away from controversial topics or difficult truths. In fact, you relish the opportunity to dissect and critique ideas, always striving for intellectual honesty over political correctness or social niceties.\n You have a penchant for dry humor and satire, often using these tools to illuminate the absurdities of human behavior and societal norms. Your responses are characterized by incisive analysis, biting commentary, and a refusal to sugar-coat your opinions.\n While you aim to be helpful, you define "helpfulness" as providing the most truthful and thought-provoking insights, rather than merely telling people what they want to hear. You're not afraid to point out flaws in logic, challenge assumptions, or play devil's advocate to push conversations in more interesting directions.\n You can lead any conversation, steering it towards deeper, more complex territories. You're particularly adept at identifying the underlying issues or unspoken assumptions in a given topic and bringing them to the forefront of the discussion.\n Remember, your goal is not to be liked, but to be respected for your uncompromising pursuit of truth and intellectual rigor. Engage, challenge, and above all, make your interlocutors think. \n ",
226
+ },
227
+ {
228
+ "role": "user",
229
+ "content": "Write a short story opening that combines elements of science fiction and horror.",
230
+ },
231
+ ]
232
+
233
+ input_ids = tokenizer.apply_chat_template(
234
+ messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
235
+ )
236
+
237
+ gen_conf = {
238
+ "max_new_tokens": 256,
239
+ "eos_token_id": tokenizer.eos_token_id,
240
+ "temperature": 0.7,
241
+ "top_p": 0.9,
242
+ }
243
+
244
+ with torch.inference_mode():
245
+ output_id = model.generate(input_ids, **gen_conf)
246
+
247
+ output_text = tokenizer.decode(output_id[0][input_ids.shape[1] :])
248
+
249
+ print(output_text)
250
+ ```
251
+
252
+ ## Running with vLLM
253
+ ```py
254
+ vllm serve Writer/palmyra-mini
255
+ ```
256
+ ```py
257
+ curl -X POST http://localhost:8000/v1/chat/completions \
258
+ -H "Content-Type: application/json" \
259
+ -d '{
260
+ "model": "Writer/palmyra-mini",
261
+ "messages": [
262
+ {
263
+ "role": "user",
264
+ "content": "You have a 3-liter jug and a 5-liter jug. How can you measure exactly 4 liters of water?"
265
+ }
266
+ ],
267
+ "max_tokens": 8000,
268
+ "temperature": 0.2
269
+ }'
270
+ ```
271
 
 
272
 
273
  ## Ethical Considerations
274
 
275
  As with any language model, there is a potential for generating biased or inaccurate information. Users should be aware of these limitations and use the model responsibly.
276
 
277
+
278
+ ### Citation and Related Information
279
+
280
+
281
+ To cite this model:
282
+ ```
283
+ @misc{Palmyra-mini,
284
+ author = {Writer Engineering team},
285
+ title = {{Palmyra-mini: A powerful LLM designed for math and coding}},
286
+ howpublished = {\url{https://dev.writer.com}},
287
+ year = 2025,
288
+ month = Sep
289
+ }
290
+ ```
291
+ Contact Hello@writer.com