Spaces:
Sleeping
Sleeping
input validation
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ SECRET_KEY = os.environ.get("summarizer")
|
|
| 10 |
|
| 11 |
# asynchronous function
|
| 12 |
async def summarize(text, retries=3):
|
| 13 |
-
if len(re.findall(r'[.!?]+', text)) < 3:
|
| 14 |
return "<span style='color: red;'>Error: Input should contain more than a few sentences.</span>"
|
| 15 |
headers = {"Authorization": f"Bearer {SECRET_KEY}"}
|
| 16 |
data = {
|
|
|
|
| 10 |
|
| 11 |
# asynchronous function
|
| 12 |
async def summarize(text, retries=3):
|
| 13 |
+
if len(re.findall(r'[.!?]+', text)) < 3 and len(text)<60:
|
| 14 |
return "<span style='color: red;'>Error: Input should contain more than a few sentences.</span>"
|
| 15 |
headers = {"Authorization": f"Bearer {SECRET_KEY}"}
|
| 16 |
data = {
|