Spaces:
Runtime error
Runtime error
Disabling 4-bit quantization
Browse files- app.py +2 -3
- requirements.txt +1 -2
app.py
CHANGED
@@ -1,16 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
-
import bitsandbytes as bnb
|
4 |
import accelerate
|
5 |
print("Bitsandbytes version:", bnb.__version__)
|
6 |
print("Accelerate version:", accelerate.__version__)
|
7 |
|
8 |
# Load the original model
|
9 |
-
original_model = AutoModelForCausalLM.from_pretrained("unsloth/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit")
|
10 |
original_tokenizer = AutoTokenizer.from_pretrained("unsloth/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit")
|
11 |
|
12 |
# Load the fine-tuned model
|
13 |
-
fine_tuned_model = AutoModelForCausalLM.from_pretrained("kas1/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit-John1")
|
14 |
fine_tuned_tokenizer = AutoTokenizer.from_pretrained("kas1/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit-John1")
|
15 |
|
16 |
# Function to generate responses from both models
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
3 |
import accelerate
|
4 |
print("Bitsandbytes version:", bnb.__version__)
|
5 |
print("Accelerate version:", accelerate.__version__)
|
6 |
|
7 |
# Load the original model
|
8 |
+
original_model = AutoModelForCausalLM.from_pretrained("unsloth/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit",load_in_4bit=False)
|
9 |
original_tokenizer = AutoTokenizer.from_pretrained("unsloth/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit")
|
10 |
|
11 |
# Load the fine-tuned model
|
12 |
+
fine_tuned_model = AutoModelForCausalLM.from_pretrained("kas1/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit-John1",load_in_4bit=False)
|
13 |
fine_tuned_tokenizer = AutoTokenizer.from_pretrained("kas1/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit-John1")
|
14 |
|
15 |
# Function to generate responses from both models
|
requirements.txt
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
torch
|
2 |
transformers
|
3 |
gradio
|
4 |
-
accelerate>=0.26.0
|
5 |
-
bitsandbytes
|
|
|
1 |
torch
|
2 |
transformers
|
3 |
gradio
|
4 |
+
accelerate>=0.26.0
|
|