ofermend commited on
Commit
72518a3
·
1 Parent(s): a8f65a9
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -160,15 +160,15 @@ def setup_db():
160
  hf_token = os.getenv('HF_TOKEN')
161
 
162
  # Load data into ev_population table
163
- df = load_dataset("vectara/ev-dataset", data_files="Electric_Vehicle_Population_Data.csv", use_auth_token=hf_token)['train'].to_pandas()
164
  df.to_sql('ev_population', conn, if_exists='replace', index=False)
165
 
166
  # Load data into county_registrations table
167
- df = load_dataset("vectara/ev-dataset", data_files="Electric_Vehicle_Population_Size_History_By_County.csv", use_auth_token=hf_token)['train'].to_pandas()
168
  df.to_sql('county_registrations', conn, if_exists='replace', index=False)
169
 
170
  # Load data into ev_registrations table
171
- df = load_dataset("vectara/ev-dataset", data_files="Electric_Vehicle_Title_and_Registration_Activity.csv", use_auth_token=hf_token)['train'].to_pandas()
172
  df.to_sql('ev_registrations', conn, if_exists='replace', index=False)
173
 
174
  # Commit changes and close connection
 
160
  hf_token = os.getenv('HF_TOKEN')
161
 
162
  # Load data into ev_population table
163
+ df = load_dataset("vectara/ev-dataset", data_files="Electric_Vehicle_Population_Data.csv", token=hf_token)['train'].to_pandas()
164
  df.to_sql('ev_population', conn, if_exists='replace', index=False)
165
 
166
  # Load data into county_registrations table
167
+ df = load_dataset("vectara/ev-dataset", data_files="Electric_Vehicle_Population_Size_History_By_County.csv", token=hf_token)['train'].to_pandas()
168
  df.to_sql('county_registrations', conn, if_exists='replace', index=False)
169
 
170
  # Load data into ev_registrations table
171
+ df = load_dataset("vectara/ev-dataset", data_files="Electric_Vehicle_Title_and_Registration_Activity.csv", token=hf_token)['train'].to_pandas()
172
  df.to_sql('ev_registrations', conn, if_exists='replace', index=False)
173
 
174
  # Commit changes and close connection