Spaces:
Runtime error
Runtime error
Amish Kushwaha commited on
Commit ·
d07f16f
1
Parent(s): 27c4f25
Fix bitsandbytes issue - attempt 3
Browse files- Dockerfile +0 -1
- app.py +2 -2
Dockerfile
CHANGED
|
@@ -3,7 +3,6 @@ FROM python:3.9
|
|
| 3 |
|
| 4 |
# Set environment variables for cache
|
| 5 |
ENV HF_HOME=/tmp/hf_home
|
| 6 |
-
ENV TRANSFORMERS_CACHE=/tmp/hf_home
|
| 7 |
|
| 8 |
# Set the working directory
|
| 9 |
WORKDIR /app
|
|
|
|
| 3 |
|
| 4 |
# Set environment variables for cache
|
| 5 |
ENV HF_HOME=/tmp/hf_home
|
|
|
|
| 6 |
|
| 7 |
# Set the working directory
|
| 8 |
WORKDIR /app
|
app.py
CHANGED
|
@@ -11,13 +11,13 @@ from transformers import (
|
|
| 11 |
# Load the configuration and remove any quantization config if present
|
| 12 |
config = AutoConfig.from_pretrained("devops-bda/Abap")
|
| 13 |
if hasattr(config, "quantization_config"):
|
| 14 |
-
config.quantization_config
|
| 15 |
|
| 16 |
# Load the model and tokenizer without 4-bit quantization
|
| 17 |
model = AutoModelForCausalLM.from_pretrained(
|
| 18 |
"devops-bda/Abap",
|
| 19 |
config=config,
|
| 20 |
-
|
| 21 |
)
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained("devops-bda/Abap")
|
| 23 |
|
|
|
|
| 11 |
# Load the configuration and remove any quantization config if present
|
| 12 |
config = AutoConfig.from_pretrained("devops-bda/Abap")
|
| 13 |
if hasattr(config, "quantization_config"):
|
| 14 |
+
del config.quantization_config # Safely delete it instead of setting to None
|
| 15 |
|
| 16 |
# Load the model and tokenizer without 4-bit quantization
|
| 17 |
model = AutoModelForCausalLM.from_pretrained(
|
| 18 |
"devops-bda/Abap",
|
| 19 |
config=config,
|
| 20 |
+
device_map="auto" # This ensures the model loads properly on CPU
|
| 21 |
)
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained("devops-bda/Abap")
|
| 23 |
|