Update app.py
Browse files
app.py
CHANGED
|
@@ -493,9 +493,12 @@ def main(api,api_base, paper_pdf, aspect, model_name, limit_num, enable_rag):
|
|
| 493 |
comments = ''
|
| 494 |
output2 = ''
|
| 495 |
retrieved_content = ''
|
| 496 |
-
if not api or not paper_pdf:
|
| 497 |
-
comments = "It looks like there's a missing API key or PDF input. Make sure you've provided the necessary information or uploaded the required file."
|
| 498 |
output2 = "It looks like there's a missing API key or PDF input. Make sure you've provided the necessary information or uploaded the required file."
|
|
|
|
|
|
|
|
|
|
| 499 |
else:
|
| 500 |
try:
|
| 501 |
reviewer1 = Reviewer(api,api_base, paper_pdf, aspect, model_name, limit_num, enable_rag)
|
|
|
|
| 493 |
comments = ''
|
| 494 |
output2 = ''
|
| 495 |
retrieved_content = ''
|
| 496 |
+
if not api or not paper_pdf or not api_base:
|
| 497 |
+
comments = "It looks like there's a missing API key/base URL or PDF input. Make sure you've provided the necessary information or uploaded the required file."
|
| 498 |
output2 = "It looks like there's a missing API key or PDF input. Make sure you've provided the necessary information or uploaded the required file."
|
| 499 |
+
if not limit_num.isdigit() or int(limit_num) <= 0:
|
| 500 |
+
comments = "The input number is not a positive integer."
|
| 501 |
+
output2 = "The input number is not a positive integer."
|
| 502 |
else:
|
| 503 |
try:
|
| 504 |
reviewer1 = Reviewer(api,api_base, paper_pdf, aspect, model_name, limit_num, enable_rag)
|