Update app.py
Browse files
app.py
CHANGED
|
@@ -14,16 +14,15 @@ MODEL_ID = "Reem1/hakayti-merged"
|
|
| 14 |
|
| 15 |
bnb_cfg = BitsAndBytesConfig(
|
| 16 |
load_in_4bit=True,
|
| 17 |
-
bnb_4bit_compute_dtype=torch.
|
| 18 |
bnb_4bit_use_double_quant=True,
|
| 19 |
bnb_4bit_quant_type="nf4",
|
| 20 |
)
|
| 21 |
-
|
| 22 |
print(" Loading model...")
|
| 23 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
| 24 |
model = AutoModelForCausalLM.from_pretrained(
|
| 25 |
MODEL_ID,
|
| 26 |
-
device_map="
|
| 27 |
quantization_config=bnb_cfg
|
| 28 |
)
|
| 29 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
|
|
|
| 14 |
|
| 15 |
bnb_cfg = BitsAndBytesConfig(
|
| 16 |
load_in_4bit=True,
|
| 17 |
+
bnb_4bit_compute_dtype=torch.float32,
|
| 18 |
bnb_4bit_use_double_quant=True,
|
| 19 |
bnb_4bit_quant_type="nf4",
|
| 20 |
)
|
|
|
|
| 21 |
print(" Loading model...")
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
| 23 |
model = AutoModelForCausalLM.from_pretrained(
|
| 24 |
MODEL_ID,
|
| 25 |
+
device_map={"": "cpu"},
|
| 26 |
quantization_config=bnb_cfg
|
| 27 |
)
|
| 28 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|