Improve model card: Add metadata tags and sample usage

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +48 -0
README.md CHANGED
@@ -1,5 +1,12 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
3
  ---
4
 
5
  <div align="center">
@@ -44,6 +51,47 @@ The Archer series focuses on research into RL algorithms and training for medium
44
  **Current Models**:
45
  - **[Archer-Code-1.5B](https://huggingface.co/Fate-Zero/Archer-Code-1.5B)** - SOTA among similarly-sized models.
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  ## Evaluation
48
  We conduct evaluation on both mathematical and coding benchmarks. Due to the high variance of the outputs from reasoning models, we report avg@K (pass@1 performance averaged over K outputs) and pass@K for each benchmark. The detailed results are shown in the table below.
49
 
 
1
  ---
2
  license: apache-2.0
3
+ pipeline_tag: text-generation
4
+ library_name: transformers
5
+ tags:
6
+ - reasoning
7
+ - code-generation
8
+ - math
9
+ - qwen2
10
  ---
11
 
12
  <div align="center">
 
51
  **Current Models**:
52
  - **[Archer-Code-1.5B](https://huggingface.co/Fate-Zero/Archer-Code-1.5B)** - SOTA among similarly-sized models.
53
 
54
+ ## Sample Usage
55
+
56
+ You can use the model with the `transformers` library:
57
+
58
+ ```python
59
+ import torch
60
+ from transformers import AutoTokenizer, AutoModelForCausalLM
61
+
62
+ # Load model and tokenizer
63
+ model_id = "Fate-Zero/Archer-Code-1.5B"
64
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
65
+ model = AutoModelForCausalLM.from_pretrained(
66
+ model_id,
67
+ torch_dtype=torch.bfloat16, # Use torch.float16 if bfloat16 is not supported on your GPU
68
+ device_map="auto"
69
+ )
70
+
71
+ # Prepare input for code generation
72
+ prompt = "Write a Python function to calculate the nth Fibonacci number."
73
+ messages = [
74
+ {"role": "user", "content": prompt},
75
+ ]
76
+
77
+ input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
78
+ model_inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
79
+
80
+ # Generate response
81
+ generated_ids = model.generate(
82
+ model_inputs.input_ids,
83
+ max_new_tokens=256,
84
+ do_sample=True,
85
+ temperature=0.7,
86
+ top_p=0.9,
87
+ eos_token_id=tokenizer.eos_token_id
88
+ )
89
+
90
+ # Decode and print
91
+ response_text = tokenizer.decode(generated_ids[0][model_inputs.input_ids.shape[1]:], skip_special_tokens=True)
92
+ print(response_text)
93
+ ```
94
+
95
  ## Evaluation
96
  We conduct evaluation on both mathematical and coding benchmarks. Due to the high variance of the outputs from reasoning models, we report avg@K (pass@1 performance averaged over K outputs) and pass@K for each benchmark. The detailed results are shown in the table below.
97