Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,11 +11,14 @@ import chainlit as cl
|
|
11 |
# Load environment variables from .env file
|
12 |
|
13 |
api_key = os.getenv('OPENAI_API_KEY')
|
|
|
14 |
|
15 |
@cl.on_chat_start
|
16 |
async def start_llm():
|
|
|
17 |
llm = ChatOpenAI(model='gpt-4o-mini',
|
18 |
temperature=0.5, api_key = api_key)
|
|
|
19 |
conversation_memory = ConversationBufferMemory(memory_key="chat_history",
|
20 |
max_len=50,
|
21 |
return_messages=True,
|
|
|
11 |
# Load environment variables from .env file
|
12 |
|
13 |
api_key = os.getenv('OPENAI_API_KEY')
|
14 |
+
print(f"api key is {api_key}")
|
15 |
|
16 |
@cl.on_chat_start
|
17 |
async def start_llm():
|
18 |
+
print("Initializing llm...")
|
19 |
llm = ChatOpenAI(model='gpt-4o-mini',
|
20 |
temperature=0.5, api_key = api_key)
|
21 |
+
print("llm initialized!")
|
22 |
conversation_memory = ConversationBufferMemory(memory_key="chat_history",
|
23 |
max_len=50,
|
24 |
return_messages=True,
|