MadMarx37 commited on
Commit
4f7dbf1
·
1 Parent(s): e8f7b94

add exception type

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -27,8 +27,8 @@ with gr.Blocks(title = "LLM Code injection", ) as demo:
27
  api_key_input = gr.Textbox(lines = 1, label = "OpenAI API Key", placeholder = "Enter your OpenAI API key", autofocus=True)
28
  try:
29
  os.environ["OPENAI_API_KEY"] = api_key_input.value
30
- except ValueError:
31
- Exception("Invalid API key")
32
 
33
  # Add a noninteractive image
34
  #gr.Image(image_path, interactive=False, label="Demonstration Image")
 
27
  api_key_input = gr.Textbox(lines = 1, label = "OpenAI API Key", placeholder = "Enter your OpenAI API key", autofocus=True)
28
  try:
29
  os.environ["OPENAI_API_KEY"] = api_key_input.value
30
+ except Exception as e:
31
+ Exception(e)
32
 
33
  # Add a noninteractive image
34
  #gr.Image(image_path, interactive=False, label="Demonstration Image")