Spaces:
Runtime error
Runtime error
Commit
·
be411a7
1
Parent(s):
c1bf31e
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,7 @@ import gradio as gr
|
|
18 |
from controller import Controller
|
19 |
|
20 |
# Loading Model
|
|
|
21 |
bnb_config = BitsAndBytesConfig(
|
22 |
load_in_4bit=True, # Load model weights in 4-bit format
|
23 |
bnb_4bit_compute_type=torch.float16 # To avoid slow inference as input type into Linear4bit is torch.float16
|
|
|
18 |
from controller import Controller
|
19 |
|
20 |
# Loading Model
|
21 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
22 |
bnb_config = BitsAndBytesConfig(
|
23 |
load_in_4bit=True, # Load model weights in 4-bit format
|
24 |
bnb_4bit_compute_type=torch.float16 # To avoid slow inference as input type into Linear4bit is torch.float16
|