SuhasGholkar commited on
Commit
db77c4f
·
verified ·
1 Parent(s): 6070769

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -31,20 +31,20 @@ import streamlit as st
31
  import matplotlib.pyplot as plt
32
 
33
  # ================= CONFIG =================
34
- DB_PATH = os.getenv("DB_PATH", "/tmp/olist.sqlite")
35
-
36
- def ensure_db():
37
- p = Path(DB_PATH)
38
- if p.exists():
39
- return
40
- from huggingface_hub import hf_hub_download
41
- repo_id = os.getenv("HF_DB_REPO", "SuhasGholkar/olist-db")
42
- filename = os.getenv("HF_DB_FILE", "olist.sqlite")
43
- token = os.getenv("HF_TOKEN") # only if dataset is private
44
- local = hf_hub_download(repo_id=repo_id, filename=filename, token=token)
45
- Path(local).replace(p)
46
-
47
- ensure_db()
48
 
49
  def ensure_views():
50
  with get_connection() as conn:
 
31
  import matplotlib.pyplot as plt
32
 
33
  # ================= CONFIG =================
34
+ DB_PATH = "/tmp/olist.sqlite"
35
+
36
+ #def ensure_db():
37
+ # p = Path(DB_PATH)
38
+ # if p.exists():
39
+ # return
40
+ # from huggingface_hub import hf_hub_download
41
+ # repo_id = os.getenv("HF_DB_REPO", "SuhasGholkar/olist-db")
42
+ # filename = os.getenv("HF_DB_FILE", "olist.sqlite")
43
+ # token = os.getenv("HF_TOKEN") # only if dataset is private
44
+ # local = hf_hub_download(repo_id=repo_id, filename=filename, token=token)
45
+ # Path(local).replace(p)
46
+
47
+ #ensure_db()
48
 
49
  def ensure_views():
50
  with get_connection() as conn: