prithivMLmods commited on
Commit
1fa99cf
·
verified ·
1 Parent(s): 1be8d66

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +40 -19
README.md CHANGED
@@ -22,25 +22,46 @@ tags:
22
 
23
  # **QwQ-LCoT-7B-Instruct Model File**
24
 
25
- The **QwQ-LCoT-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.
26
-
27
- | **File Name** | **Size** | **Description** | **Upload Status** |
28
- |----------------------------------------|----------------|-------------------------------------------------|--------------------|
29
- | `.gitattributes` | 1.57 kB | Tracks large files with Git LFS. | Uploaded |
30
- | `README.md` | 273 Bytes | Contains initial documentation, likely minimal. | Updated |
31
- | `added_tokens.json` | 657 Bytes | Maps additional tokens for the tokenizer. | Uploaded |
32
- | `config.json` | 848 Bytes | Model configuration (basic setup). | Uploaded |
33
- | `generation_config.json` | 281 Bytes | Settings for text generation tasks. | Uploaded |
34
- | `merges.txt` | 1.82 MB | Tokenizer merges for byte-pair encoding (BPE). | Uploaded |
35
- | `model-00001-of-00004.safetensors` | 4.88 GB | First part of model weights (split for LFS). | Uploaded (LFS) |
36
- | `model-00002-of-00004.safetensors` | 4.93 GB | Second part of model weights. | Uploaded (LFS) |
37
- | `model-00003-of-00004.safetensors` | 4.33 GB | Third part of model weights. | Uploaded (LFS) |
38
- | `model-00004-of-00004.safetensors` | 1.09 GB | Fourth part of model weights. | Uploaded (LFS) |
39
- | `model.safetensors.index.json` | 29.5 kB | Index file for managing model shards. | Uploaded |
40
- | `special_tokens_map.json` | 644 Bytes | Maps special tokens like `<pad>` or `<eos>`. | Uploaded |
41
- | `tokenizer.json` | 11.4 MB | Pre-trained tokenizer file in JSON format. | Uploaded (LFS) |
42
- | `tokenizer_config.json` | 7.73 kB | Configuration details for the tokenizer. | Uploaded |
43
- | `vocab.json` | 2.78 MB | Tokenizer vocabulary. | Uploaded |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  ### **Sample Long CoT:**
46
 
 
22
 
23
  # **QwQ-LCoT-7B-Instruct Model File**
24
 
25
+ The QwQ-LCoT-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.
26
+
27
+ ## Quickstart with Transformers
28
+
29
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
30
+
31
+ ```python
32
+ from transformers import AutoModelForCausalLM, AutoTokenizer
33
+
34
+ model_name = "prithivMLmods/QwQ-LCoT-7B-Instruct"
35
+
36
+ model = AutoModelForCausalLM.from_pretrained(
37
+ model_name,
38
+ torch_dtype="auto",
39
+ device_map="auto"
40
+ )
41
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
42
+
43
+ prompt = "How many r in strawberry."
44
+ messages = [
45
+ {"role": "system", "content": "You are a helpful and harmless assistant. You are Qwen developed by Alibaba. You should think step-by-step."},
46
+ {"role": "user", "content": prompt}
47
+ ]
48
+ text = tokenizer.apply_chat_template(
49
+ messages,
50
+ tokenize=False,
51
+ add_generation_prompt=True
52
+ )
53
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
54
+
55
+ generated_ids = model.generate(
56
+ **model_inputs,
57
+ max_new_tokens=512
58
+ )
59
+ generated_ids = [
60
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
61
+ ]
62
+
63
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
64
+ ```
65
 
66
  ### **Sample Long CoT:**
67