Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,10 +17,12 @@ chat_history = []
|
|
| 17 |
chain = None # Initialize chain as None
|
| 18 |
|
| 19 |
# Function to set the OpenAI API key
|
| 20 |
-
def set_apikey(api_key):
|
| 21 |
-
os.environ['OPENAI_API_KEY'] = api_key
|
| 22 |
-
return disable_box
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
# Function to enable the API key input box
|
| 25 |
def enable_api_box():
|
| 26 |
return enable_box
|
|
@@ -94,7 +96,7 @@ with st.container():
|
|
| 94 |
</style>
|
| 95 |
""")
|
| 96 |
|
| 97 |
-
|
| 98 |
pdf_upload1 = gr.UploadButton("📁 Upload PDF 1", file_types=[".pdf"]) # Define pdf_upload1
|
| 99 |
|
| 100 |
# ... (rest of your interface creation)
|
|
|
|
| 17 |
chain = None # Initialize chain as None
|
| 18 |
|
| 19 |
# Function to set the OpenAI API key
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
api_key = os.environ['OPENAI_API_KEY']
|
| 22 |
+
|
| 23 |
+
st.write(api_key)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
# Function to enable the API key input box
|
| 27 |
def enable_api_box():
|
| 28 |
return enable_box
|
|
|
|
| 96 |
</style>
|
| 97 |
""")
|
| 98 |
|
| 99 |
+
with gr.Blocks() as demo:
|
| 100 |
pdf_upload1 = gr.UploadButton("📁 Upload PDF 1", file_types=[".pdf"]) # Define pdf_upload1
|
| 101 |
|
| 102 |
# ... (rest of your interface creation)
|