Spaces:
Paused
Paused
Wenye He
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,10 +39,10 @@ class ChatModel:
|
|
| 39 |
|
| 40 |
model = AutoModelForCausalLM.from_pretrained(
|
| 41 |
config["model_name"],
|
| 42 |
-
quantization_config=bnb_config,
|
| 43 |
device_map="auto",
|
| 44 |
-
|
| 45 |
-
|
|
|
|
| 46 |
)
|
| 47 |
|
| 48 |
self.models[model_name] = model
|
|
|
|
| 39 |
|
| 40 |
model = AutoModelForCausalLM.from_pretrained(
|
| 41 |
config["model_name"],
|
|
|
|
| 42 |
device_map="auto",
|
| 43 |
+
torch_dtype=torch.float16,
|
| 44 |
+
attn_implementation="flash_attention_2" if "phi-3" in model_name else "eager",
|
| 45 |
+
low_cpu_mem_usage=True
|
| 46 |
)
|
| 47 |
|
| 48 |
self.models[model_name] = model
|