manu commited on
Commit
713698c
·
verified ·
1 Parent(s): 40e26e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -26,7 +26,7 @@ from openai import OpenAI
26
  # =============================
27
  # Globals & Config
28
  # =============================
29
- api_key_env = os.getenv("OPENAI_API_KEY", "").strip()
30
 
31
  ds: List[torch.Tensor] = [] # page embeddings
32
  images: List[Image.Image] = [] # PIL images in page order
@@ -349,6 +349,8 @@ def stream_agent(question: str,
349
  yield "⚠️ **Please provide your OpenAI API key.**", "", ""
350
  return
351
 
 
 
352
  if not images or not ds:
353
  yield "⚠️ **Index a PDF first in tab 1.**", "", ""
354
  return
 
26
  # =============================
27
  # Globals & Config
28
  # =============================
29
+ api_key_env = None
30
 
31
  ds: List[torch.Tensor] = [] # page embeddings
32
  images: List[Image.Image] = [] # PIL images in page order
 
349
  yield "⚠️ **Please provide your OpenAI API key.**", "", ""
350
  return
351
 
352
+ api_key_env=api_key
353
+
354
  if not images or not ds:
355
  yield "⚠️ **Index a PDF first in tab 1.**", "", ""
356
  return