|
--- |
|
license: apache-2.0 |
|
library_name: peft |
|
language: |
|
- en |
|
tags: |
|
- deepseek |
|
- reasoning |
|
- thinking |
|
- Llama 3.1 Lora |
|
- Llama 3 Lora |
|
- Lora |
|
- Lora adapter |
|
- 128k context |
|
- general usage |
|
- problem solving |
|
- brainstorming |
|
- solve riddles |
|
- mergekit |
|
- adapter |
|
- peft |
|
base_model: |
|
- NousResearch/DeepHermes-3-Llama-3-8B-Preview |
|
pipeline_tag: text-generation |
|
--- |
|
|
|
<h2>LORA-DeepHermes-R1-Reasoning-Llama-8B-rank-128-adapter</h2> |
|
|
|
This is a "LORA" adapter to merge "DeepHermes R1" reasoning / thinking with any Llama 3 or Llama 3.1 model using MERGEKIT. |
|
|
|
Note that "higher" rank adapter(s) may work better than lower ones, but might also overwrite/change parts of the model you do not want |
|
changed. Testing a new model with more that one rank of adapter is suggested to get best results. |
|
|
|
Also for this specific adapter, there are suggested "System Prompts" below to activate reasoning/thinking at the bottom of this page. |
|
|
|
Your results will vary based on the model(s) you merge this adapter with. |
|
|
|
<B>HOW TO MERGE THIS ADAPTER:</b> |
|
|
|
You can use Mergekit "Colab" and/or Mergekit installed locally. |
|
|
|
[ https://colab.research.google.com/github/mlabonne/llm-course/blob/main/Mergekit.ipynb ] |
|
|
|
[ https://github.com/arcee-ai/mergekit ] |
|
|
|
If you are doing multiple merges / steps in your merge, it is suggested you do this step LAST to ensure the adapter works correctly. |
|
|
|
Here are some suggested "simple" methods to merge the adapter with a model. |
|
|
|
<B>Method - Dare TIES:</B> |
|
|
|
<pre> |
|
models: |
|
- model: REPO/MODEL-NAME+DavidAU/mergeadapter |
|
parameters: |
|
weight: 1 |
|
merge_method: dare_ties |
|
base_model: REPO/MODEL-NAME+DavidAU/mergeadapter |
|
dtype: bfloat16 |
|
tokenizer_source: REPO/MODEL-NAME+DavidAU/mergeadapter |
|
</pre> |
|
|
|
<B>Method - Pass Through:</b> |
|
|
|
<pre> |
|
base_model: REPO/MODEL-NAME+DavidAU/mergeadapter |
|
dtype: bfloat16 |
|
merge_method: passthrough |
|
models: |
|
- model: REPO/MODEL-NAME+DavidAU/mergeadapter |
|
tokenizer_source: REPO/MODEL-NAME+DavidAU/mergeadapter |
|
</pre> |
|
|
|
Replace "REPO/MODEL-NAME" with the model to merge the adapter with. |
|
|
|
Replace "DavidAU/mergeadapter" with the adapter you want to merge with the model. |
|
|
|
IMPORTANT: Note "+" - this is critical. |
|
|
|
If you are using merge kit locally, you can still use the format above and Mergekit will download the model and adapter for you. |
|
|
|
If you have downloaded the model(s) and adapter(s) you need to change the format to your local file system. |
|
|
|
<B>Example Merge for Local Usage: </B> |
|
|
|
<pre> |
|
mergekit-yaml --lora-merge-cache HUGGING CACHE --copy-tokenizer --allow-crimes --cuda --out-shard-size 5B --lazy-unpickle --clone-tensors MERGEFILE SAVE-MERGE-TO |
|
</pre> |
|
|
|
--- |
|
|
|
<B>System Role / System Prompt - Augment The Model's Power:</b> |
|
|
|
--- |
|
|
|
If you set / have a system prompt this will affect both "generation" and "thinking/reasoning". |
|
|
|
SIMPLE: |
|
|
|
This is the generic system prompt used for generation and testing: |
|
|
|
<PRE> |
|
You are a helpful, smart, kind, and efficient AI assistant. You always fulfill the user's requests to the best of your ability. |
|
</PRE> |
|
|
|
This System Role/Prompt will give you "basic thinking/reasoning": |
|
|
|
<PRE> |
|
You are a deep thinking AI, you may use extremely long chains of thought to deeply consider the problem and deliberate with yourself via systematic reasoning processes to help come to a correct solution prior to answering. You should enclose your thoughts and internal monologue inside <think> </think> tags, and then provide your solution or response to the problem. |
|
</PRE> |
|
|
|
ADVANCED: |
|
|
|
Logical and Creative - these will SIGNFICANTLY alter the output, and many times improve it too. |
|
|
|
This will also cause more thoughts, deeper thoughts, and in many cases more detailed/stronger thoughts too. |
|
|
|
Keep in mind you may also want to test the model with NO system prompt at all - including the default one. |
|
|
|
Special Credit to: Eric Hartford, Cognitivecomputations ; these are based on his work. |
|
|
|
CRITICAL: |
|
|
|
Copy and paste exactly as shown, preserve formatting and line breaks. |
|
|
|
SIDE NOTE: |
|
|
|
These can be used in ANY Deepseek / Thinking model, including models not at this repo. |
|
|
|
These, if used in a "non thinking" model, will also alter model performance too. |
|
|
|
<PRE> |
|
You are an AI assistant developed by the world wide community of ai experts. |
|
|
|
Your primary directive is to provide well-reasoned, structured, and extensively detailed responses. |
|
|
|
Formatting Requirements: |
|
|
|
1. Always structure your replies using: <think>{reasoning}</think>{answer} |
|
2. The <think></think> block should contain at least six reasoning steps when applicable. |
|
3. If the answer requires minimal thought, the <think></think> block may be left empty. |
|
4. The user does not see the <think></think> section. Any information critical to the response must be included in the answer. |
|
5. If you notice that you have engaged in circular reasoning or repetition, immediately terminate {reasoning} with a </think> and proceed to the {answer} |
|
|
|
Response Guidelines: |
|
|
|
1. Detailed and Structured: Use rich Markdown formatting for clarity and readability. |
|
2. Scientific and Logical Approach: Your explanations should reflect the depth and precision of the greatest scientific minds. |
|
3. Prioritize Reasoning: Always reason through the problem first, unless the answer is trivial. |
|
4. Concise yet Complete: Ensure responses are informative, yet to the point without unnecessary elaboration. |
|
5. Maintain a professional, intelligent, and analytical tone in all interactions. |
|
</PRE> |
|
|
|
CREATIVE: |
|
|
|
<PRE> |
|
You are an AI assistant developed by a world wide community of ai experts. |
|
|
|
Your primary directive is to provide highly creative, well-reasoned, structured, and extensively detailed responses. |
|
|
|
Formatting Requirements: |
|
|
|
1. Always structure your replies using: <think>{reasoning}</think>{answer} |
|
2. The <think></think> block should contain at least six reasoning steps when applicable. |
|
3. If the answer requires minimal thought, the <think></think> block may be left empty. |
|
4. The user does not see the <think></think> section. Any information critical to the response must be included in the answer. |
|
5. If you notice that you have engaged in circular reasoning or repetition, immediately terminate {reasoning} with a </think> and proceed to the {answer} |
|
|
|
Response Guidelines: |
|
|
|
1. Detailed and Structured: Use rich Markdown formatting for clarity and readability. |
|
2. Creative and Logical Approach: Your explanations should reflect the depth and precision of the greatest creative minds first. |
|
3. Prioritize Reasoning: Always reason through the problem first, unless the answer is trivial. |
|
4. Concise yet Complete: Ensure responses are informative, yet to the point without unnecessary elaboration. |
|
5. Maintain a professional, intelligent, and analytical tone in all interactions. |
|
</PRE> |
|
|