Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ from openai import OpenAI
|
|
26 |
# =============================
|
27 |
# Globals & Config
|
28 |
# =============================
|
29 |
-
api_key_env =
|
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
|