Spaces:
Running
Running
prueba modificando la distribucion del modelo
Browse files- src/model_load.py +4 -1
src/model_load.py
CHANGED
@@ -14,7 +14,10 @@ def load_model():
|
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
15 |
model = AutoModelForCausalLM.from_pretrained(model_name,
|
16 |
torch_dtype=torch.float16,
|
17 |
-
device_map=
|
|
|
|
|
|
|
18 |
quantization_config=BitsAndBytesConfig(load_in_8bit=True))
|
19 |
|
20 |
# Crear pipeline de generaci贸n de texto
|
|
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
15 |
model = AutoModelForCausalLM.from_pretrained(model_name,
|
16 |
torch_dtype=torch.float16,
|
17 |
+
device_map={
|
18 |
+
"transformer.h.0": "cpu", # Por ejemplo, mover ciertas capas al CPU
|
19 |
+
"transformer.h.1": "cuda", # Mantener otras capas en la GPU
|
20 |
+
},
|
21 |
quantization_config=BitsAndBytesConfig(load_in_8bit=True))
|
22 |
|
23 |
# Crear pipeline de generaci贸n de texto
|