retries if fails to generate answer
Browse files- app/utils.py +2 -2
app/utils.py
CHANGED
|
@@ -20,12 +20,12 @@ from core.llms.utils import user_message_with_images
|
|
| 20 |
from PIL import Image
|
| 21 |
from streamlit.runtime.uploaded_file_manager import UploadedFile
|
| 22 |
from core.prompts.decision_prompt import PLAN_SYSTEM_PROMPT, COTorDAPromptOutput, Decision
|
| 23 |
-
from tenacity import retry, stop_after_attempt,
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
-
@retry(stop=stop_after_attempt(3))
|
| 29 |
def cot_or_da_func(problem: str, llm: BaseLLM = None, **kwargs) -> COTorDAPromptOutput:
|
| 30 |
|
| 31 |
cot_decision_message = [
|
|
|
|
| 20 |
from PIL import Image
|
| 21 |
from streamlit.runtime.uploaded_file_manager import UploadedFile
|
| 22 |
from core.prompts.decision_prompt import PLAN_SYSTEM_PROMPT, COTorDAPromptOutput, Decision
|
| 23 |
+
from tenacity import retry, stop_after_attempt, wait_incrementing
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
+
@retry(stop=stop_after_attempt(3), wait=wait_incrementing())
|
| 29 |
def cot_or_da_func(problem: str, llm: BaseLLM = None, **kwargs) -> COTorDAPromptOutput:
|
| 30 |
|
| 31 |
cot_decision_message = [
|