Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,10 +14,6 @@ print(zero.device) # <-- 'cpu' 🤔
|
|
14 |
|
15 |
@spaces.GPU
|
16 |
def greet(prompts, separator):
|
17 |
-
print('prompts:')
|
18 |
-
print(prompts)
|
19 |
-
print('separator')
|
20 |
-
print(separator)
|
21 |
# print(zero.device) # <-- 'cuda:0' 🤗
|
22 |
from vllm import SamplingParams, LLM
|
23 |
from transformers.utils import move_cache
|
@@ -42,6 +38,11 @@ def greet(prompts, separator):
|
|
42 |
prompts = prompts.split('separator')
|
43 |
else:
|
44 |
prompts = [prompts]
|
|
|
|
|
|
|
|
|
|
|
45 |
model_outputs = model.generate(prompts, sampling_params)
|
46 |
generations = []
|
47 |
for output in model_outputs:
|
|
|
14 |
|
15 |
@spaces.GPU
|
16 |
def greet(prompts, separator):
|
|
|
|
|
|
|
|
|
17 |
# print(zero.device) # <-- 'cuda:0' 🤗
|
18 |
from vllm import SamplingParams, LLM
|
19 |
from transformers.utils import move_cache
|
|
|
38 |
prompts = prompts.split('separator')
|
39 |
else:
|
40 |
prompts = [prompts]
|
41 |
+
for idx, pt in enumerate(prompts):
|
42 |
+
print()
|
43 |
+
print(f'[{idx}]:')
|
44 |
+
print(pt)
|
45 |
+
|
46 |
model_outputs = model.generate(prompts, sampling_params)
|
47 |
generations = []
|
48 |
for output in model_outputs:
|