Spaces:
Paused
Paused
hanoch.rahimi@gmail
commited on
Commit
·
9376584
1
Parent(s):
6bab25c
results not initialized fix
Browse files- app.py +1 -0
- openai_utils.py +2 -2
app.py
CHANGED
@@ -33,6 +33,7 @@ COUNTRIES_FN="data/countries.csv"
|
|
33 |
country_geo = pd.read_csv(COUNTRIES_FN)
|
34 |
|
35 |
st.session_state.index = utils.init_pinecone()
|
|
|
36 |
|
37 |
carddict = {
|
38 |
"name": [],
|
|
|
33 |
country_geo = pd.read_csv(COUNTRIES_FN)
|
34 |
|
35 |
st.session_state.index = utils.init_pinecone()
|
36 |
+
st.session_state.results = []
|
37 |
|
38 |
carddict = {
|
39 |
"name": [],
|
openai_utils.py
CHANGED
@@ -23,8 +23,8 @@ def get_client():
|
|
23 |
|
24 |
def getListOfCompanies(query, filters = {}):
|
25 |
country_filters = filters['country'] if 'country' in filters else st.session_state.country
|
26 |
-
st.session_state.
|
27 |
-
descriptions = "\n".join([f"Description of company \"{res['name']}\": {res['data']['Summary']}.\n" for res in st.session_state.
|
28 |
return descriptions
|
29 |
|
30 |
def wait_for_response(thread, run):
|
|
|
23 |
|
24 |
def getListOfCompanies(query, filters = {}):
|
25 |
country_filters = filters['country'] if 'country' in filters else st.session_state.country
|
26 |
+
st.session_state.db_search_results = utils.search_index(query, st.session_state.top_k, st.session_state.region, country_filters, st.session_state.retriever, st.session_state.index_namespace)
|
27 |
+
descriptions = "\n".join([f"Description of company \"{res['name']}\": {res['data']['Summary']}.\n" for res in st.session_state.db_search_results[:20] if 'Summary' in res['data']])
|
28 |
return descriptions
|
29 |
|
30 |
def wait_for_response(thread, run):
|