Gregor Betz commited on
Commit
bcfbb35
1 Parent(s): e389c90

missing urls

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -95,21 +95,6 @@ with open("config.yaml") as stream:
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.error(f"Error processing config: {exc}")
115
  gr.Error(f"Error processing config: {exc}")
@@ -227,6 +212,21 @@ with gr.Blocks() as demo:
227
  tos_approved = gr.State(False)
228
 
229
  # set up client and guide
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  client_llm = setup_client_llm(**client_kwargs)
231
  guide_config = RecursiveBalancingGuideConfig(**guide_kwargs)
232
  guide = RecursiveBalancingGuide(tourist_llm=client_llm, config=guide_config)
 
95
 
96
  try:
97
  client_kwargs, guide_kwargs = process_config(demo_config)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  except Exception as exc:
99
  logging.error(f"Error processing config: {exc}")
100
  gr.Error(f"Error processing config: {exc}")
 
212
  tos_approved = gr.State(False)
213
 
214
  # set up client and guide
215
+ if not client_kwargs["url"]:
216
+ gr.Error(
217
+ "Please set the client model inference endpoint in the config.yaml file.",
218
+ duration=-1
219
+ )
220
+ if not guide_kwargs["url"]:
221
+ gr.Error(
222
+ "Please set the expert model inference endpoint in the config.yaml file.",
223
+ duration=-1
224
+ )
225
+ if not guide_kwargs["classifier_kwargs"]["url"]:
226
+ gr.Error(
227
+ "Please set the classifier model inference endpoint in the config.yaml file.",
228
+ duration=-1
229
+ )
230
  client_llm = setup_client_llm(**client_kwargs)
231
  guide_config = RecursiveBalancingGuideConfig(**guide_kwargs)
232
  guide = RecursiveBalancingGuide(tourist_llm=client_llm, config=guide_config)