hellno-o commited on
Commit
2501733
1 Parent(s): 44be985

try fix running in hf.co

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -61,9 +61,10 @@ def download_dataset():
61
 
62
  @st.cache
63
  def load_dataset(feature_set: str):
64
- print('load_dataset with feature_set', feature_set)
 
65
  # read the feature metadata and get a feature set (or all the features)
66
- with open("v4/features.json", "r") as f:
67
  feature_metadata = json.load(f)
68
  # features = list(feature_metadata["feature_stats"].keys()) # get all the features
69
  # features = feature_metadata["feature_sets"]["small"] # get the small
@@ -75,9 +76,9 @@ def load_dataset(feature_set: str):
75
  # note: sometimes when trying to read the downloaded data you get an error about invalid magic parquet bytes...
76
  # if so, delete the file and rerun the napi.download_dataset to fix the
77
  # corrupted file
78
- training_data = pd.read_parquet('v4/train.parquet',
79
  columns=read_columns)
80
- validation_data = pd.read_parquet('v4/validation.parquet',
81
  columns=read_columns)
82
  live_data = pd.read_parquet(f'v4/live_{current_round}.parquet',
83
  columns=read_columns)
@@ -215,7 +216,7 @@ def get_model_preds(model_name, *params):
215
  validation_data["prediction"].to_csv(validation_prediction_fname)
216
  live_data["prediction"].to_csv(f"live_predictions_{current_round}.csv")
217
 
218
- validation_preds = pd.read_parquet('v4/validation_example_preds.parquet')
219
  validation_data[EXAMPLE_PREDS_COL] = validation_preds["prediction"]
220
 
221
  # get some stats about each of our models to compare...
 
61
 
62
  @st.cache
63
  def load_dataset(feature_set: str):
64
+ dataset_path = get_dataset_path()
65
+ print(f'load_dataset with feature_set {feature_set} and path {dataset_path}')
66
  # read the feature metadata and get a feature set (or all the features)
67
+ with open(f"{dataset_path}/features.json", "r") as f:
68
  feature_metadata = json.load(f)
69
  # features = list(feature_metadata["feature_stats"].keys()) # get all the features
70
  # features = feature_metadata["feature_sets"]["small"] # get the small
 
76
  # note: sometimes when trying to read the downloaded data you get an error about invalid magic parquet bytes...
77
  # if so, delete the file and rerun the napi.download_dataset to fix the
78
  # corrupted file
79
+ training_data = pd.read_parquet(f'{dataset_path}/train.parquet',
80
  columns=read_columns)
81
+ validation_data = pd.read_parquet(f'{dataset_path}/validation.parquet',
82
  columns=read_columns)
83
  live_data = pd.read_parquet(f'v4/live_{current_round}.parquet',
84
  columns=read_columns)
 
216
  validation_data["prediction"].to_csv(validation_prediction_fname)
217
  live_data["prediction"].to_csv(f"live_predictions_{current_round}.csv")
218
 
219
+ validation_preds = pd.read_parquet(f'{get_dataset_path()}/validation_example_preds.parquet')
220
  validation_data[EXAMPLE_PREDS_COL] = validation_preds["prediction"]
221
 
222
  # get some stats about each of our models to compare...