Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,11 +17,12 @@ try:
|
|
17 |
trust_remote_code=True # <-- ADDED HERE
|
18 |
)
|
19 |
model = AutoModelForCausalLM.from_pretrained(
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
25 |
)
|
26 |
except Exception as e:
|
27 |
raise gr.Error(f"Error loading model: {str(e)}")
|
|
|
17 |
trust_remote_code=True # <-- ADDED HERE
|
18 |
)
|
19 |
model = AutoModelForCausalLM.from_pretrained(
|
20 |
+
MODEL_NAME,
|
21 |
+
device_map="auto",
|
22 |
+
torch_dtype="auto",
|
23 |
+
trust_remote_code=True,
|
24 |
+
use_flash_attention_2=True, # <-- Add this line
|
25 |
+
# load_in_4bit=True
|
26 |
)
|
27 |
except Exception as e:
|
28 |
raise gr.Error(f"Error loading model: {str(e)}")
|