Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- modal_backend.py +5 -5
- src/ui/gradio_app.py +1 -1
modal_backend.py
CHANGED
|
@@ -115,7 +115,7 @@ def calculate_sentiment(text: str) -> float:
|
|
| 115 |
@app.function(
|
| 116 |
image=image,
|
| 117 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 118 |
-
timeout=
|
| 119 |
retries=3,
|
| 120 |
memory=512, # [INIT-04] Added memory config
|
| 121 |
)
|
|
@@ -252,7 +252,7 @@ Extract everything:"""
|
|
| 252 |
@app.function(
|
| 253 |
image=image,
|
| 254 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 255 |
-
timeout=
|
| 256 |
retries=3,
|
| 257 |
memory=512, # [INIT-04] Added memory config
|
| 258 |
)
|
|
@@ -401,7 +401,7 @@ def _fallback_insights(role: str) -> Dict[str, Any]:
|
|
| 401 |
@app.function(
|
| 402 |
image=image,
|
| 403 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 404 |
-
timeout=
|
| 405 |
memory=512, # [INIT-04] Added memory config
|
| 406 |
)
|
| 407 |
def generate_all_summaries(
|
|
@@ -492,7 +492,7 @@ CRITICAL: Output ONLY valid JSON. Generate summaries for ALL items listed above.
|
|
| 492 |
@app.function(
|
| 493 |
image=image,
|
| 494 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 495 |
-
timeout=
|
| 496 |
memory=1024, # [INIT-04] Added memory config for main function
|
| 497 |
)
|
| 498 |
def full_analysis_parallel(url: str, max_reviews: int = 100) -> Dict[str, Any]:
|
|
@@ -891,7 +891,7 @@ def full_analysis_parallel(url: str, max_reviews: int = 100) -> Dict[str, Any]:
|
|
| 891 |
@app.function(
|
| 892 |
image=image,
|
| 893 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 894 |
-
timeout=
|
| 895 |
memory=1024, # [INIT-04] Added memory config
|
| 896 |
)
|
| 897 |
@modal.asgi_app()
|
|
|
|
| 115 |
@app.function(
|
| 116 |
image=image,
|
| 117 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 118 |
+
timeout=210,
|
| 119 |
retries=3,
|
| 120 |
memory=512, # [INIT-04] Added memory config
|
| 121 |
)
|
|
|
|
| 252 |
@app.function(
|
| 253 |
image=image,
|
| 254 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 255 |
+
timeout=210,
|
| 256 |
retries=3,
|
| 257 |
memory=512, # [INIT-04] Added memory config
|
| 258 |
)
|
|
|
|
| 401 |
@app.function(
|
| 402 |
image=image,
|
| 403 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 404 |
+
timeout=210,
|
| 405 |
memory=512, # [INIT-04] Added memory config
|
| 406 |
)
|
| 407 |
def generate_all_summaries(
|
|
|
|
| 492 |
@app.function(
|
| 493 |
image=image,
|
| 494 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 495 |
+
timeout=2100, # [API-06] Increased from 600 to 900 (15 min)
|
| 496 |
memory=1024, # [INIT-04] Added memory config for main function
|
| 497 |
)
|
| 498 |
def full_analysis_parallel(url: str, max_reviews: int = 100) -> Dict[str, Any]:
|
|
|
|
| 891 |
@app.function(
|
| 892 |
image=image,
|
| 893 |
secrets=[modal.Secret.from_name("anthropic-api-key")],
|
| 894 |
+
timeout=2100, # [API-06] Increased from 900 to 1200 (20 min) for API endpoint
|
| 895 |
memory=1024, # [INIT-04] Added memory config
|
| 896 |
)
|
| 897 |
@modal.asgi_app()
|
src/ui/gradio_app.py
CHANGED
|
@@ -1439,7 +1439,7 @@ def analyze_restaurant(url: str, review_count: int):
|
|
| 1439 |
response = session.post(
|
| 1440 |
f"{MODAL_API_URL}/analyze",
|
| 1441 |
json={"url": url, "max_reviews": review_count},
|
| 1442 |
-
timeout=(30,
|
| 1443 |
headers={"Connection": "keep-alive"}
|
| 1444 |
)
|
| 1445 |
|
|
|
|
| 1439 |
response = session.post(
|
| 1440 |
f"{MODAL_API_URL}/analyze",
|
| 1441 |
json={"url": url, "max_reviews": review_count},
|
| 1442 |
+
timeout=(30, 2100), # 30s connect, 600s read (10 min)
|
| 1443 |
headers={"Connection": "keep-alive"}
|
| 1444 |
)
|
| 1445 |
|