Spaces:
Paused
Paused
commit
Browse files
app.py
CHANGED
|
@@ -124,7 +124,7 @@ image_pipe.enable_model_cpu_offload()
|
|
| 124 |
|
| 125 |
@spaces.GPU(duration=40)
|
| 126 |
def summarize_text(
|
| 127 |
-
text, max_length=
|
| 128 |
pegasus_tokenizer = PegasusTokenizerFast.from_pretrained("google/pegasus-xsum"),
|
| 129 |
pegasus_model = PegasusForConditionalGeneration.from_pretrained("google/pegasus-xsum")
|
| 130 |
):
|
|
@@ -139,7 +139,7 @@ def generate_random_string(length):
|
|
| 139 |
characters = str(ascii_letters + digits)
|
| 140 |
return ''.join(random.choice(characters) for _ in range(length))
|
| 141 |
|
| 142 |
-
@spaces.GPU(duration=
|
| 143 |
def pipe_generate(p1,p2):
|
| 144 |
return image_pipe(
|
| 145 |
prompt=p1,
|
|
|
|
| 124 |
|
| 125 |
@spaces.GPU(duration=40)
|
| 126 |
def summarize_text(
|
| 127 |
+
text, max_length=30, num_beams=4, early_stopping=True,
|
| 128 |
pegasus_tokenizer = PegasusTokenizerFast.from_pretrained("google/pegasus-xsum"),
|
| 129 |
pegasus_model = PegasusForConditionalGeneration.from_pretrained("google/pegasus-xsum")
|
| 130 |
):
|
|
|
|
| 139 |
characters = str(ascii_letters + digits)
|
| 140 |
return ''.join(random.choice(characters) for _ in range(length))
|
| 141 |
|
| 142 |
+
@spaces.GPU(duration=120)
|
| 143 |
def pipe_generate(p1,p2):
|
| 144 |
return image_pipe(
|
| 145 |
prompt=p1,
|