Spaces:
Sleeping
Sleeping
Upload main.py with huggingface_hub
Browse files
main.py
CHANGED
|
@@ -95,14 +95,14 @@ def startup():
|
|
| 95 |
mode = "remote httpfs" if is_remote else "local files"
|
| 96 |
print(f"Data mode: {mode}")
|
| 97 |
|
| 98 |
-
#
|
|
|
|
| 99 |
db.execute(f"""
|
| 100 |
CREATE TABLE results AS
|
| 101 |
SELECT * FROM read_parquet('{results_src}')
|
| 102 |
""")
|
| 103 |
-
# Features: remote view (only fetched on demand for feature deep dives)
|
| 104 |
db.execute(f"""
|
| 105 |
-
CREATE
|
| 106 |
SELECT * FROM read_parquet('{features_src}')
|
| 107 |
""")
|
| 108 |
|
|
|
|
| 95 |
mode = "remote httpfs" if is_remote else "local files"
|
| 96 |
print(f"Data mode: {mode}")
|
| 97 |
|
| 98 |
+
# Load both tables into memory for reliable, fast queries.
|
| 99 |
+
# Total ~100MB in RAM — well within cpu-basic 2GB limit.
|
| 100 |
db.execute(f"""
|
| 101 |
CREATE TABLE results AS
|
| 102 |
SELECT * FROM read_parquet('{results_src}')
|
| 103 |
""")
|
|
|
|
| 104 |
db.execute(f"""
|
| 105 |
+
CREATE TABLE features AS
|
| 106 |
SELECT * FROM read_parquet('{features_src}')
|
| 107 |
""")
|
| 108 |
|