Spaces:
Sleeping
Sleeping
Update blueprints/summarize.py
Browse files- blueprints/summarize.py +8 -2
blueprints/summarize.py
CHANGED
|
@@ -66,8 +66,14 @@ def run_inference_logic(config):
|
|
| 66 |
}
|
| 67 |
|
| 68 |
elif task_type == 'SEQ_2_SEQ_LM':
|
| 69 |
-
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
return {"output": out[0]['summary_text']}
|
| 72 |
|
| 73 |
else:
|
|
|
|
| 66 |
}
|
| 67 |
|
| 68 |
elif task_type == 'SEQ_2_SEQ_LM':
|
| 69 |
+
out = pipe(
|
| 70 |
+
text,
|
| 71 |
+
max_length=512,
|
| 72 |
+
min_length=30,
|
| 73 |
+
do_sample=True,
|
| 74 |
+
temperature=config['temp'],
|
| 75 |
+
top_k=config['topk']
|
| 76 |
+
)
|
| 77 |
return {"output": out[0]['summary_text']}
|
| 78 |
|
| 79 |
else:
|