Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from threading import Thread
|
2 |
|
3 |
import torch
|
@@ -20,6 +21,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
20 |
assistant_model = AutoModelForCausalLM.from_pretrained(assistant_id).to(torch_device)
|
21 |
|
22 |
|
|
|
23 |
def run_generation(user_text, use_assistant, temperature, max_new_tokens):
|
24 |
if temperature < 0.1:
|
25 |
do_sample = False
|
|
|
1 |
+
import spaces
|
2 |
from threading import Thread
|
3 |
|
4 |
import torch
|
|
|
21 |
assistant_model = AutoModelForCausalLM.from_pretrained(assistant_id).to(torch_device)
|
22 |
|
23 |
|
24 |
+
@spaces.GPU
|
25 |
def run_generation(user_text, use_assistant, temperature, max_new_tokens):
|
26 |
if temperature < 0.1:
|
27 |
do_sample = False
|