complynx commited on
Commit
5dedbfc
Β·
1 Parent(s): aa023ea

Fix another issue with model

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -83,12 +83,12 @@ def bot(history, model_name, oepnai_api_key,
83
  prompt_html = template_html.render(documents=documents, query=query)
84
 
85
 
86
- if model_name == "HuggingFace":
87
  generate_fn = generate_hf
88
- elif model_name == "OpenAI":
89
  generate_fn = generate_openai
90
  else:
91
- raise gr.Error(f"API {model_name} is not supported")
92
 
93
 
94
  history[-1][1] = ""
 
83
  prompt_html = template_html.render(documents=documents, query=query)
84
 
85
 
86
+ if model_name in hf_models:
87
  generate_fn = generate_hf
88
+ elif model_name in openai_models:
89
  generate_fn = generate_openai
90
  else:
91
+ raise gr.Error(f"Model {model_name} is not supported")
92
 
93
 
94
  history[-1][1] = ""