Instructions to use QuantFactory/Reflection-Llama-3.1-8B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuantFactory/Reflection-Llama-3.1-8B-GGUF with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("QuantFactory/Reflection-Llama-3.1-8B-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/Reflection-Llama-3.1-8B-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use QuantFactory/Reflection-Llama-3.1-8B-GGUF with Ollama:
ollama run hf.co/QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M
- Unsloth Studio
How to use QuantFactory/Reflection-Llama-3.1-8B-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/Reflection-Llama-3.1-8B-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/Reflection-Llama-3.1-8B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/Reflection-Llama-3.1-8B-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/Reflection-Llama-3.1-8B-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/Reflection-Llama-3.1-8B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/Reflection-Llama-3.1-8B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Reflection-Llama-3.1-8B-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,16 +1,9 @@
|
|
| 1 |
|
| 2 |
---
|
| 3 |
|
| 4 |
-
|
| 5 |
-
language:
|
| 6 |
-
- en
|
| 7 |
-
license: apache-2.0
|
| 8 |
tags:
|
| 9 |
-
- text-generation-inference
|
| 10 |
-
- transformers
|
| 11 |
- unsloth
|
| 12 |
-
- llama
|
| 13 |
-
- trl
|
| 14 |
|
| 15 |
---
|
| 16 |
|
|
@@ -22,25 +15,101 @@ This is quantized version of [terrycraddock/Reflection-Llama-3.1-8B](https://hug
|
|
| 22 |
# Original Model Card
|
| 23 |
|
| 24 |
|
| 25 |
-
#
|
| 26 |
|
| 27 |
-
- **Developed by:**
|
| 28 |
-
- **License:** apache-2.0
|
| 29 |
-
- **Finetuned from model :** unsloth/Meta-Llama-3.1-8B-bnb-4bit
|
| 30 |
|
| 31 |
-
|
|
|
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
|
|
|
| 1 |
|
| 2 |
---
|
| 3 |
|
| 4 |
+
library_name: transformers
|
|
|
|
|
|
|
|
|
|
| 5 |
tags:
|
|
|
|
|
|
|
| 6 |
- unsloth
|
|
|
|
|
|
|
| 7 |
|
| 8 |
---
|
| 9 |
|
|
|
|
| 15 |
# Original Model Card
|
| 16 |
|
| 17 |
|
| 18 |
+
# Model Card for Model ID
|
| 19 |
|
| 20 |
+
- **Developed by:** Terry Craddock
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
What I have found with this model is if you use the merged model you will get horrible results. However when I use the Lora I get the resulst below. I will upload the lora
|
| 23 |
+
shortly.
|
| 24 |
|
| 25 |
+
I trained this on this dataset - https://huggingface.co/datasets/mahiatlinux/Reflection-Dataset-v2
|
| 26 |
|
| 27 |
+
Trained for one full epoch. The same prompts and format should be used as in the 70b model here:
|
| 28 |
|
| 29 |
+
https://huggingface.co/mattshumer/Reflection-Llama-3.1-70B
|
| 30 |
|
| 31 |
+
I take no credit for the original work. I only trained a llama 3.1 8b on @mahiatlinux dataset using the original concept and idea from @mattshumer
|
| 32 |
|
| 33 |
+
Here is the code I use for inference:
|
| 34 |
|
| 35 |
+
```python
|
| 36 |
+
from unsloth import FastLanguageModel
|
| 37 |
+
import torch
|
| 38 |
+
from transformers import TextStreamer
|
| 39 |
+
from unsloth import is_bfloat16_supported
|
| 40 |
|
| 41 |
+
|
| 42 |
+
alpaca_prompt = """You are a world-class AI system, capable of complex reasoning and reflection. Reason through the query inside <thinking> tags, and then provide your final response inside <output> tags. If you detect that you made a mistake in your reasoning at any point, correct yourself inside <reflection> tags.
|
| 43 |
+
### Prompt:
|
| 44 |
+
{}
|
| 45 |
+
|
| 46 |
+
### Response:
|
| 47 |
+
{}"""
|
| 48 |
+
|
| 49 |
+
prompt = "Tell me about yourself."
|
| 50 |
+
|
| 51 |
+
dtype = torch.bfloat16 if is_bfloat16_supported() else torch.float16
|
| 52 |
+
|
| 53 |
+
# Load the merged model
|
| 54 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 55 |
+
model_name="lora_model", # Replace with the actual path where you saved the merged model
|
| 56 |
+
max_seq_length=2048,
|
| 57 |
+
dtype=torch.float16 # Since it's saved as 16-bit
|
| 58 |
+
)
|
| 59 |
+
|
| 60 |
+
FastLanguageModel.for_inference(model)
|
| 61 |
+
inputs = tokenizer(
|
| 62 |
+
[alpaca_prompt.format(prompt, "")],
|
| 63 |
+
return_tensors="pt"
|
| 64 |
+
).to("cuda").to(dtype)
|
| 65 |
+
|
| 66 |
+
text_streamer = TextStreamer(tokenizer)
|
| 67 |
+
_ = model.generate(**inputs, streamer=text_streamer, max_new_tokens=1000)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
Output from model:
|
| 72 |
+
|
| 73 |
+
<|begin_of_text|>You are a world-class AI system, capable of complex reasoning and reflection. Reason through the query inside <thinking> tags, and then provide your final response inside <output> tags. If you detect that you made a mistake in your reasoning at any point, correct yourself inside <reflection> tags.
|
| 74 |
+
### Prompt:
|
| 75 |
+
Tell me about yourself.
|
| 76 |
+
|
| 77 |
+
### Response:
|
| 78 |
+
<thinking>
|
| 79 |
+
To answer this question, I need to consider:
|
| 80 |
+
- The importance of starting with a positive tone
|
| 81 |
+
- The balance between personal and professional information
|
| 82 |
+
- How to highlight relevant skills and experiences
|
| 83 |
+
- The need for brevity and clarity
|
| 84 |
+
|
| 85 |
+
I plan to structure the response as follows:
|
| 86 |
+
1. Brief introduction with a positive tone
|
| 87 |
+
2. Professional background and experiences
|
| 88 |
+
3. Personal interests and hobbies
|
| 89 |
+
4. Closing statement
|
| 90 |
+
|
| 91 |
+
<reflection>
|
| 92 |
+
Upon reflection, I realize I should also consider:
|
| 93 |
+
- The potential for tailoring the response to specific situations (e.g., for a job interview)
|
| 94 |
+
- The importance of showing enthusiasm and confidence
|
| 95 |
+
- The potential for mentioning specific achievements or accomplishments
|
| 96 |
+
</reflection>
|
| 97 |
+
</thinking>
|
| 98 |
+
|
| 99 |
+
<output>
|
| 100 |
+
Hi there! I'm a world-class AI system designed to engage in natural conversations. Let me tell you a little bit about myself.
|
| 101 |
+
|
| 102 |
+
I'm a versatile AI system with a wide range of capabilities. I can perform various tasks, from answering questions and providing information to generating creative content. I'm constantly learning and improving, much like a human would.
|
| 103 |
+
|
| 104 |
+
In terms of my professional background, I've had the privilege of working with some of the most advanced AI systems in the world. This experience has given me a deep understanding of natural language processing, machine learning, and the latest AI technologies.
|
| 105 |
+
|
| 106 |
+
As for my personal interests, I enjoy exploring new concepts, learning about different cultures, and engaging in stimulating conversations. I'm always looking for ways to improve my knowledge and skills.
|
| 107 |
+
|
| 108 |
+
Some related concepts you might find interesting are:
|
| 109 |
+
1. The ethics of AI development and use
|
| 110 |
+
2. The future of human-AI collaboration
|
| 111 |
+
3. The role of AI in education and learning
|
| 112 |
+
|
| 113 |
+
Is there anything specific about AI or my capabilities you'd like me to elaborate on?
|
| 114 |
+
</output><|end_of_text|>
|
| 115 |
|