Spaces:
Running
on
Zero
Running
on
Zero
PommesPeter
commited on
Commit
•
5400148
1
Parent(s):
27f38eb
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ import json
|
|
9 |
import multiprocessing as mp
|
10 |
import random
|
11 |
import socket
|
|
|
12 |
import traceback
|
13 |
|
14 |
import fairscale.nn.model_parallel.initialize as fs_init
|
@@ -108,6 +109,7 @@ def encode_prompt(
|
|
108 |
return prompt_embeds, prompt_masks
|
109 |
|
110 |
|
|
|
111 |
@torch.no_grad()
|
112 |
def model_main(args, master_port, rank, request_queue, response_queue, mp_barrier):
|
113 |
# import here to avoid huggingface Tokenizer parallelism warnings
|
@@ -592,7 +594,7 @@ def main():
|
|
592 |
)
|
593 |
|
594 |
mp_barrier.wait()
|
595 |
-
demo.queue().launch(
|
596 |
|
597 |
|
598 |
if __name__ == "__main__":
|
|
|
9 |
import multiprocessing as mp
|
10 |
import random
|
11 |
import socket
|
12 |
+
import spaces
|
13 |
import traceback
|
14 |
|
15 |
import fairscale.nn.model_parallel.initialize as fs_init
|
|
|
109 |
return prompt_embeds, prompt_masks
|
110 |
|
111 |
|
112 |
+
@spaces.GPU
|
113 |
@torch.no_grad()
|
114 |
def model_main(args, master_port, rank, request_queue, response_queue, mp_barrier):
|
115 |
# import here to avoid huggingface Tokenizer parallelism warnings
|
|
|
594 |
)
|
595 |
|
596 |
mp_barrier.wait()
|
597 |
+
demo.queue(max_size=20).launch()
|
598 |
|
599 |
|
600 |
if __name__ == "__main__":
|