benhaotang
commited on
Commit
•
433da6f
1
Parent(s):
4d2b312
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ def load_model():
|
|
25 |
|
26 |
model, tokenizer = load_model()
|
27 |
|
28 |
-
@spaces.GPU(duration=
|
29 |
def generate_response(prompt, max_length=1024):
|
30 |
inputs = tokenizer(prompt, return_tensors="pt").to("cuda" if torch.cuda.is_available() else "cpu")
|
31 |
outputs = model.generate(**inputs, max_length=max_length)
|
|
|
25 |
|
26 |
model, tokenizer = load_model()
|
27 |
|
28 |
+
@spaces.GPU(duration=110) # Added the decorator here
|
29 |
def generate_response(prompt, max_length=1024):
|
30 |
inputs = tokenizer(prompt, return_tensors="pt").to("cuda" if torch.cuda.is_available() else "cpu")
|
31 |
outputs = model.generate(**inputs, max_length=max_length)
|