Spaces:
Running
Running
update requirements- Remove bitsandbytes dependency, update init pipeline-Disable 8-bit quantization
Browse files- helper.py +4 -2
- requirements.txt +1 -1
helper.py
CHANGED
@@ -46,13 +46,15 @@ def get_huggingface_api_key():
|
|
46 |
MODEL_CONFIG = {
|
47 |
"main_model": {
|
48 |
"name": "meta-llama/Llama-3.2-3B-Instruct",
|
49 |
-
"dtype": torch.bfloat16,
|
|
|
50 |
"max_length": 512,
|
51 |
"device": "cuda" if torch.cuda.is_available() else "cpu",
|
52 |
},
|
53 |
"safety_model": {
|
54 |
"name": "meta-llama/Llama-Guard-3-1B",
|
55 |
-
"dtype": torch.bfloat16,
|
|
|
56 |
"max_length": 256,
|
57 |
"device": "cuda" if torch.cuda.is_available() else "cpu",
|
58 |
},
|
|
|
46 |
MODEL_CONFIG = {
|
47 |
"main_model": {
|
48 |
"name": "meta-llama/Llama-3.2-3B-Instruct",
|
49 |
+
# "dtype": torch.bfloat16,
|
50 |
+
"dtype": torch.float32, # Use float32 for CPU
|
51 |
"max_length": 512,
|
52 |
"device": "cuda" if torch.cuda.is_available() else "cpu",
|
53 |
},
|
54 |
"safety_model": {
|
55 |
"name": "meta-llama/Llama-Guard-3-1B",
|
56 |
+
# "dtype": torch.bfloat16,
|
57 |
+
"dtype": torch.float32, # Use float32 for CPU
|
58 |
"max_length": 256,
|
59 |
"device": "cuda" if torch.cuda.is_available() else "cpu",
|
60 |
},
|
requirements.txt
CHANGED
@@ -2,7 +2,7 @@ accelerate==1.1.1
|
|
2 |
aiofiles==23.2.1
|
3 |
annotated-types==0.7.0
|
4 |
anyio==4.6.2.post1
|
5 |
-
bitsandbytes==0.45.0
|
6 |
certifi==2024.8.30
|
7 |
charset-normalizer==3.4.0
|
8 |
click==8.1.7
|
|
|
2 |
aiofiles==23.2.1
|
3 |
annotated-types==0.7.0
|
4 |
anyio==4.6.2.post1
|
5 |
+
# bitsandbytes==0.45.0
|
6 |
certifi==2024.8.30
|
7 |
charset-normalizer==3.4.0
|
8 |
click==8.1.7
|