amaye15
commited on
Commit
•
b105566
1
Parent(s):
5150064
clear cache
Browse files
app.py
CHANGED
@@ -23,10 +23,6 @@ def clear_huggingface_cache():
|
|
23 |
print("Cache directory does not exist.")
|
24 |
|
25 |
|
26 |
-
# Example usage
|
27 |
-
clear_huggingface_cache()
|
28 |
-
|
29 |
-
|
30 |
# Disable caching globally for Hugging Face datasets
|
31 |
disable_caching()
|
32 |
|
@@ -55,13 +51,13 @@ def get_data():
|
|
55 |
Uses streaming to avoid loading the entire dataset into memory at once,
|
56 |
which is useful for handling large datasets.
|
57 |
"""
|
|
|
58 |
ds = load_dataset(
|
59 |
DS_NAME,
|
60 |
streaming=True,
|
61 |
)
|
62 |
for row in ds["train"]:
|
63 |
yield row
|
64 |
-
clear_huggingface_cache()
|
65 |
|
66 |
|
67 |
def process_and_push_data():
|
@@ -77,7 +73,6 @@ def process_and_push_data():
|
|
77 |
ds_processed.push_to_hub(TARGET_REPO)
|
78 |
|
79 |
logger.info("Data processed and pushed to the hub.")
|
80 |
-
clear_huggingface_cache()
|
81 |
|
82 |
|
83 |
# Initialize the WebhooksServer with Gradio interface (if needed)
|
|
|
23 |
print("Cache directory does not exist.")
|
24 |
|
25 |
|
|
|
|
|
|
|
|
|
26 |
# Disable caching globally for Hugging Face datasets
|
27 |
disable_caching()
|
28 |
|
|
|
51 |
Uses streaming to avoid loading the entire dataset into memory at once,
|
52 |
which is useful for handling large datasets.
|
53 |
"""
|
54 |
+
clear_huggingface_cache()
|
55 |
ds = load_dataset(
|
56 |
DS_NAME,
|
57 |
streaming=True,
|
58 |
)
|
59 |
for row in ds["train"]:
|
60 |
yield row
|
|
|
61 |
|
62 |
|
63 |
def process_and_push_data():
|
|
|
73 |
ds_processed.push_to_hub(TARGET_REPO)
|
74 |
|
75 |
logger.info("Data processed and pushed to the hub.")
|
|
|
76 |
|
77 |
|
78 |
# Initialize the WebhooksServer with Gradio interface (if needed)
|