realcodeninja commited on
Commit
af56d89
1 Parent(s): da0c7e5

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -1,5 +1,5 @@
1
  # handler.py
2
-
3
  from PIL import Image
4
  from diffusers import (
5
  StableDiffusionControlNetImg2ImgPipeline,
@@ -12,7 +12,7 @@ import openai
12
  from io import BytesIO
13
  import base64
14
  import qrcode
15
-
16
 
17
  class EndpointHandler:
18
  def __init__(
@@ -60,7 +60,7 @@ class EndpointHandler:
60
  height,
61
  num_inference_steps,
62
  ):
63
- openai.api_key = "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"
64
 
65
  qr = qrcode.QRCode(
66
  version=1,
 
1
  # handler.py
2
+ from dotenv import load_dotenv
3
  from PIL import Image
4
  from diffusers import (
5
  StableDiffusionControlNetImg2ImgPipeline,
 
12
  from io import BytesIO
13
  import base64
14
  import qrcode
15
+ load_dotenv()
16
 
17
  class EndpointHandler:
18
  def __init__(
 
60
  height,
61
  num_inference_steps,
62
  ):
63
+ openai.api_key = os.getenv("OPENAI_KEY")
64
 
65
  qr = qrcode.QRCode(
66
  version=1,