jamescalam commited on
Commit
6659a19
1 Parent(s): cfebb04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -49,7 +49,10 @@ def query(xq, top_k=10, include_values=True, include_metadata=True, filter=None)
49
  )
50
  matches = xc['matches']
51
  break
52
- except ProtocolError:
 
 
 
53
  attempt += 1
54
  matches = []
55
  if len(matches) == 0:
 
49
  )
50
  matches = xc['matches']
51
  break
52
+ except:
53
+ # force reload
54
+ pinecone.init(api_key=PINECONE_API_KEY, environment="us-west1-gcp")
55
+ st.session_state.index = pinecone.Index(INDEX)
56
  attempt += 1
57
  matches = []
58
  if len(matches) == 0: