davanstrien HF staff commited on
Commit
9380316
1 Parent(s): 9472c85
Files changed (1) hide show
  1. app.py +8 -43
app.py CHANGED
@@ -1,21 +1,15 @@
1
- from huggingface_hub import hf_hub_url, list_datasets
2
- from dotenv import load_dotenv
3
  import os
 
 
 
 
 
 
 
4
  from httpx import Client
5
- from datetime import datetime
6
- from datetime import timedelta
7
  from tqdm.auto import tqdm
8
  from tqdm.contrib.concurrent import thread_map
9
- import pandas as pd
10
- import gradio as gr
11
-
12
- from huggingface_hub import hf_hub_url
13
- from diskcache import Cache
14
- from sys import platform
15
- import gradio as gr
16
-
17
- # check if running on macos i.e. local dev
18
-
19
 
20
  load_dotenv()
21
 
@@ -159,35 +153,6 @@ def filter_df_by_max_age(max_age_days=None):
159
  return df
160
 
161
 
162
- # def filter_df(
163
- # min_age_days=None,
164
- # max_age_days=None,
165
- # min_likes=None,
166
- # max_likes=None,
167
- # min_len=None,
168
- # max_len=None,
169
- # min_downloads=None,
170
- # max_downloads=None,
171
- # ):
172
- # if min_age_days is not None or max_age_days is not None:
173
- # df = filter_df_by_date(min_age_days, max_age_days)
174
- # else:
175
- # df = prep_dataframe()
176
- # if min_likes:
177
- # df = df[df["likes"] >= min_likes]
178
- # if max_likes:
179
- # df = df[df["likes"] <= max_likes]
180
- # if min_len:
181
- # df = df[df["len"] >= min_len]
182
- # if max_len:
183
- # df = df[df["len"] <= max_len]
184
- # if min_downloads:
185
- # df = df[df["downloads"] >= min_downloads]
186
- # if max_downloads:
187
- # df = df[df["downloads"] <= max_downloads]
188
- # return df
189
-
190
-
191
  with gr.Blocks() as demo:
192
  max_age_days = gr.Slider(
193
  label="Max Age (days)", value=7, minimum=0, maximum=90, step=1, interactive=True
 
 
 
1
  import os
2
+ from datetime import datetime, timedelta
3
+ from sys import platform
4
+
5
+ import gradio as gr
6
+ import pandas as pd
7
+ from diskcache import Cache
8
+ from dotenv import load_dotenv
9
  from httpx import Client
10
+ from huggingface_hub import hf_hub_url, list_datasets
 
11
  from tqdm.auto import tqdm
12
  from tqdm.contrib.concurrent import thread_map
 
 
 
 
 
 
 
 
 
 
13
 
14
  load_dotenv()
15
 
 
153
  return df
154
 
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  with gr.Blocks() as demo:
157
  max_age_days = gr.Slider(
158
  label="Max Age (days)", value=7, minimum=0, maximum=90, step=1, interactive=True