vexoolabs commited on
Commit
2e0c86f
·
verified ·
1 Parent(s): c353186

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +51 -37
README.md CHANGED
@@ -10,6 +10,7 @@ tags:
10
  - problem-solving
11
  - unsloth
12
  - lora
 
13
  license: apache-2.0
14
  datasets:
15
  - openai/gsm8k
@@ -61,9 +62,57 @@ You are an advanced reasoning assistant that excels at solving complex problems.
61
  5. Verify your conclusions with examples or counterexamples
62
  ```
63
 
64
- ## Usage with Unsloth
65
 
66
- For optimal performance, load with Unsloth:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  ```python
69
  # Import unsloth first
@@ -88,38 +137,3 @@ tokenizer = get_chat_template(tokenizer, chat_template="llama-3.1")
88
  # Prepare for inference
89
  FastLanguageModel.for_inference(model)
90
  ```
91
-
92
- ## Example Usage
93
-
94
- ```python
95
- # Create messages with system prompt
96
- messages = [
97
- {"role": "system", "content": "You are an advanced reasoning assistant that excels at solving complex problems."},
98
- {"role": "user", "content": "If a train travels at 60 miles per hour, how far will it travel in 2.5 hours?"}
99
- ]
100
-
101
- # Apply chat template
102
- inputs = tokenizer.apply_chat_template(
103
- messages,
104
- tokenize=True,
105
- add_generation_prompt=True,
106
- return_tensors="pt"
107
- ).to(model.device)
108
-
109
- # Generate response
110
- with torch.no_grad():
111
- outputs = model.generate(
112
- inputs,
113
- max_new_tokens=300,
114
- temperature=0.2,
115
- top_p=0.92,
116
- repetition_penalty=1.05,
117
- do_sample=True,
118
- pad_token_id=tokenizer.pad_token_id,
119
- eos_token_id=tokenizer.eos_token_id,
120
- )
121
-
122
- # Decode response
123
- response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
124
- print(response)
125
- ```
 
10
  - problem-solving
11
  - unsloth
12
  - lora
13
+ library_name: transformers
14
  license: apache-2.0
15
  datasets:
16
  - openai/gsm8k
 
62
  5. Verify your conclusions with examples or counterexamples
63
  ```
64
 
65
+ ## Usage with Transformers
66
 
67
+ The model can be loaded using standard Transformers library:
68
+
69
+ ```python
70
+ from transformers import AutoModelForCausalLM, AutoTokenizer
71
+
72
+ model_name = "vexoolabs/Vexoo-TrailBlazer-1B"
73
+
74
+ # Load tokenizer and model
75
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
76
+ model = AutoModelForCausalLM.from_pretrained(
77
+ model_name,
78
+ torch_dtype="auto",
79
+ device_map="auto"
80
+ )
81
+
82
+ # System prompt for reasoning
83
+ system_prompt = "You are an advanced reasoning assistant that excels at solving complex problems."
84
+ user_question = "If a train travels at 60 miles per hour, how far will it travel in 2.5 hours?"
85
+
86
+ # Format with system prompt
87
+ messages = [
88
+ {"role": "system", "content": system_prompt},
89
+ {"role": "user", "content": user_question}
90
+ ]
91
+
92
+ # Format prompt
93
+ inputs = tokenizer.apply_chat_template(
94
+ messages,
95
+ return_tensors="pt",
96
+ add_generation_prompt=True
97
+ ).to(model.device)
98
+
99
+ # Generate
100
+ outputs = model.generate(
101
+ inputs,
102
+ max_new_tokens=300,
103
+ temperature=0.2,
104
+ top_p=0.92,
105
+ repetition_penalty=1.05,
106
+ do_sample=True
107
+ )
108
+
109
+ response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
110
+ print(response)
111
+ ```
112
+
113
+ ## Advanced Usage with Unsloth
114
+
115
+ For optimal performance, you can also load with Unsloth:
116
 
117
  ```python
118
  # Import unsloth first
 
137
  # Prepare for inference
138
  FastLanguageModel.for_inference(model)
139
  ```