Gregor Betz
commited on
progress
Browse files
app.py
CHANGED
|
@@ -95,6 +95,21 @@ with open("config.yaml") as stream:
|
|
| 95 |
|
| 96 |
try:
|
| 97 |
client_kwargs, guide_kwargs = process_config(demo_config)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
except Exception as exc:
|
| 99 |
logging.getLogger(__name__).error(f"Error processing config: {exc}")
|
| 100 |
gr.Error(f"Error processing config: {exc}")
|
|
@@ -171,6 +186,7 @@ async def bot(
|
|
| 171 |
artifacts[otype.value] = ovalue
|
| 172 |
else:
|
| 173 |
break
|
|
|
|
| 174 |
except asyncio.TimeoutError:
|
| 175 |
msg = "Guided reasoning process took too long. Please try again."
|
| 176 |
raise gr.Error(msg)
|
|
|
|
| 95 |
|
| 96 |
try:
|
| 97 |
client_kwargs, guide_kwargs = process_config(demo_config)
|
| 98 |
+
if not client_kwargs["url"]:
|
| 99 |
+
gr.Error(
|
| 100 |
+
"Please set the client model inference endpoint in the config.yaml file.",
|
| 101 |
+
duration=-1
|
| 102 |
+
)
|
| 103 |
+
if not guide_kwargs["url"]:
|
| 104 |
+
gr.Error(
|
| 105 |
+
"Please set the expert model inference endpoint in the config.yaml file.",
|
| 106 |
+
duration=-1
|
| 107 |
+
)
|
| 108 |
+
if not guide_kwargs["classifier_kwargs"]["url"]:
|
| 109 |
+
gr.Error(
|
| 110 |
+
"Please set the classifier model inference endpoint in the config.yaml file.",
|
| 111 |
+
duration=-1
|
| 112 |
+
)
|
| 113 |
except Exception as exc:
|
| 114 |
logging.getLogger(__name__).error(f"Error processing config: {exc}")
|
| 115 |
gr.Error(f"Error processing config: {exc}")
|
|
|
|
| 186 |
artifacts[otype.value] = ovalue
|
| 187 |
else:
|
| 188 |
break
|
| 189 |
+
asyncio.sleep(0.1)
|
| 190 |
except asyncio.TimeoutError:
|
| 191 |
msg = "Guided reasoning process took too long. Please try again."
|
| 192 |
raise gr.Error(msg)
|