chahah commited on
Commit
73c9b3c
·
verified ·
1 Parent(s): fc4028e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -74,10 +74,13 @@ def initialize(arxivcode):
74
  rag_chain = None
75
 
76
  def handle_prompt(message, history, arxivcode):
77
- if rag_chain is None:
 
 
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