Spaces:
Sleeping
Sleeping
Staticaliza
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -9,12 +9,12 @@ model_id = "xmadai/Mistral-Large-Instruct-2407-xMADai-INT4"
|
|
9 |
# Load the tokenizer
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False, trust_remote_code=True)
|
11 |
|
12 |
-
|
13 |
class ModelWrapper:
|
14 |
def __init__(self):
|
15 |
self.model = None # Model will be loaded when GPU is allocated
|
16 |
|
17 |
-
@spaces.GPU
|
18 |
def generate(self, prompt):
|
19 |
if self.model is None:
|
20 |
# Load the model when GPU is allocated
|
|
|
9 |
# Load the tokenizer
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False, trust_remote_code=True)
|
11 |
|
12 |
+
# Removed the invalid decorator
|
13 |
class ModelWrapper:
|
14 |
def __init__(self):
|
15 |
self.model = None # Model will be loaded when GPU is allocated
|
16 |
|
17 |
+
@spaces.GPU # Use the correct decorator
|
18 |
def generate(self, prompt):
|
19 |
if self.model is None:
|
20 |
# Load the model when GPU is allocated
|