Update app.py
Browse files
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
|
33 |
raise gr.Error("OpenAI API Key is required.")
|
34 |
-
if
|
35 |
raise gr.Error("Prompt is required.")
|
36 |
-
if
|
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:
|