Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,10 +74,13 @@ def initialize(arxivcode):
|
|
| 74 |
rag_chain = None
|
| 75 |
|
| 76 |
def handle_prompt(message, history, arxivcode):
|
| 77 |
-
|
|
|
|
|
|
|
| 78 |
# initialize RAG chain
|
| 79 |
# RAG chain
|
| 80 |
rag_chain = initialize(arxivcode)
|
|
|
|
| 81 |
|
| 82 |
try:
|
| 83 |
# Stream output
|
|
|
|
| 74 |
rag_chain = None
|
| 75 |
|
| 76 |
def handle_prompt(message, history, arxivcode):
|
| 77 |
+
try:
|
| 78 |
+
rag_chain
|
| 79 |
+
except UnboundLocalError:
|
| 80 |
# initialize RAG chain
|
| 81 |
# RAG chain
|
| 82 |
rag_chain = initialize(arxivcode)
|
| 83 |
+
global rag_chain
|
| 84 |
|
| 85 |
try:
|
| 86 |
# Stream output
|