Update app.py
Browse files
app.py
CHANGED
|
@@ -68,6 +68,13 @@ rag_chain = (
|
|
| 68 |
| StrOutputParser()
|
| 69 |
)
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
# Define the chat response function
|
| 72 |
def chatresponse(message, history):
|
| 73 |
output = rag_chain.invoke(message)
|
|
|
|
| 68 |
| StrOutputParser()
|
| 69 |
)
|
| 70 |
|
| 71 |
+
def warmup_model():
|
| 72 |
+
dummy_context = {"context": "dummy context", "question": "dummy question"}
|
| 73 |
+
rag_chain.invoke(dummy_context)
|
| 74 |
+
|
| 75 |
+
# Call the warm-up function during startup
|
| 76 |
+
warmup_model()
|
| 77 |
+
|
| 78 |
# Define the chat response function
|
| 79 |
def chatresponse(message, history):
|
| 80 |
output = rag_chain.invoke(message)
|