nikhilkomakula commited on
Commit
257e702
·
1 Parent(s): 87932ba

Added dependency pysqlite3

Browse files
Files changed (2) hide show
  1. requirements.txt +1 -0
  2. streamlit_app.py +10 -0
requirements.txt CHANGED
@@ -9,3 +9,4 @@ tensorflow==2.16.1
9
  gradio==4.21.0
10
  pandas==2.2.1
11
  streamlit==1.32.2
 
 
9
  gradio==4.21.0
10
  pandas==2.2.1
11
  streamlit==1.32.2
12
+ pysqlite3-binary==0.5.2.post3
streamlit_app.py CHANGED
@@ -1,4 +1,11 @@
 
 
 
 
 
1
  # import libraries
 
 
2
  from dotenv import find_dotenv, load_dotenv
3
 
4
  # import functions
@@ -10,6 +17,9 @@ def main():
10
  # find .env automatically by walking up directories until it's found, then
11
  # load up the .env entries as environment variables
12
  load_dotenv(find_dotenv())
 
 
 
13
 
14
  # get the qa chain
15
  qa_chain = get_qa_chain()
 
1
+ # code to fix the issue with sqllite version on streamlit.io
2
+ __import__('pysqlite3')
3
+ import sys
4
+ sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
5
+
6
  # import libraries
7
+ import os
8
+ import streamlit as st
9
  from dotenv import find_dotenv, load_dotenv
10
 
11
  # import functions
 
17
  # find .env automatically by walking up directories until it's found, then
18
  # load up the .env entries as environment variables
19
  load_dotenv(find_dotenv())
20
+
21
+ if st.secrets["HUGGINGFACEHUB_API_TOKEN"]:
22
+ os.environ["HUGGINGFACEHUB_API_TOKEN"] = st.secrets["HUGGINGFACEHUB_API_TOKEN"]
23
 
24
  # get the qa chain
25
  qa_chain = get_qa_chain()