prithivMLmods commited on
Commit
d7b4ea6
·
verified ·
1 Parent(s): fdfafd0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +46 -1
README.md CHANGED
@@ -15,4 +15,49 @@ datasets:
15
  - prithivMLmods/Math-Solve
16
  - amphora/QwQ-LongCoT-130K
17
  - prithivMLmods/Deepthink-Reasoning
18
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  - prithivMLmods/Math-Solve
16
  - amphora/QwQ-LongCoT-130K
17
  - prithivMLmods/Deepthink-Reasoning
18
+ ---
19
+
20
+
21
+
22
+ # **QwQ-LCoT-7B-Instruct**
23
+
24
+ The *QwQ-LCoT2-7B-Instruct* is a fine-tuned language model designed for advanced reasoning and instruction-following tasks. It leverages the Qwen2.5-7B base model and has been fine-tuned on the amphora/QwQ-LongCoT-130K dataset, focusing on chain-of-thought (CoT) reasoning. This model is optimized for tasks requiring logical reasoning, detailed explanations, and multi-step problem-solving, making it ideal for applications such as instruction-following, text generation, and complex reasoning tasks.
25
+
26
+ ## Quickstart with Transformers
27
+
28
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
29
+
30
+ ```python
31
+ from transformers import AutoModelForCausalLM, AutoTokenizer
32
+
33
+ model_name = "prithivMLmods/QwQ-LCoT2-7B-Instruct"
34
+
35
+ model = AutoModelForCausalLM.from_pretrained(
36
+ model_name,
37
+ torch_dtype="auto",
38
+ device_map="auto"
39
+ )
40
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
41
+
42
+ prompt = "How many r in strawberry."
43
+ messages = [
44
+ {"role": "system", "content": "You are a helpful and harmless assistant. You are Qwen developed by Alibaba. You should think step-by-step."},
45
+ {"role": "user", "content": prompt}
46
+ ]
47
+ text = tokenizer.apply_chat_template(
48
+ messages,
49
+ tokenize=False,
50
+ add_generation_prompt=True
51
+ )
52
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
53
+
54
+ generated_ids = model.generate(
55
+ **model_inputs,
56
+ max_new_tokens=512
57
+ )
58
+ generated_ids = [
59
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
60
+ ]
61
+
62
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
63
+ ```