bstraehle commited on
Commit
4d74cbf
1 Parent(s): caeaee0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -29,11 +29,11 @@ logging.basicConfig(stream = sys.stdout, level = logging.INFO)
29
  logging.getLogger().addHandler(logging.StreamHandler(stream = sys.stdout))
30
 
31
  def invoke(openai_api_key, prompt, rag_option):
32
- if (openai_api_key == ""):
33
  raise gr.Error("OpenAI API Key is required.")
34
- if (prompt == ""):
35
  raise gr.Error("Prompt is required.")
36
- if (rag_option is None):
37
  raise gr.Error("Retrieval-Augmented Generation is required.")
38
 
39
  with lock:
 
29
  logging.getLogger().addHandler(logging.StreamHandler(stream = sys.stdout))
30
 
31
  def invoke(openai_api_key, prompt, rag_option):
32
+ if not openai_api_key:
33
  raise gr.Error("OpenAI API Key is required.")
34
+ if not prompt:
35
  raise gr.Error("Prompt is required.")
36
+ if not rag_option:
37
  raise gr.Error("Retrieval-Augmented Generation is required.")
38
 
39
  with lock: