Spaces:
Runtime error
Runtime error
Commit
·
e6064e2
1
Parent(s):
d14e6f5
refactor: Remove unnecessary uvicorn import and commented code in main.py
Browse files- data_loader.py +5 -9
- main.py +3 -3
data_loader.py
CHANGED
@@ -125,16 +125,12 @@ def refresh_data() -> List[Dict[str, Any]]:
|
|
125 |
df = df.astype({"hub_id": "string", "config_name": "string"})
|
126 |
|
127 |
# save to parquet file with current date
|
128 |
-
df.to_parquet(f"datasets_{now.strftime('%Y-%m-%d')}.parquet")
|
129 |
|
130 |
-
# save to JSON file with current date
|
131 |
-
df.to_json(
|
132 |
-
|
133 |
-
)
|
134 |
|
135 |
# return a list of dictionaries
|
136 |
return df.to_dict(orient="records")
|
137 |
-
|
138 |
-
|
139 |
-
if __name__ == "__main__":
|
140 |
-
refresh_data()
|
|
|
125 |
df = df.astype({"hub_id": "string", "config_name": "string"})
|
126 |
|
127 |
# save to parquet file with current date
|
128 |
+
# df.to_parquet(f"datasets_{now.strftime('%Y-%m-%d')}.parquet")
|
129 |
|
130 |
+
# # save to JSON file with current date
|
131 |
+
# df.to_json(
|
132 |
+
# f"datasets_{now.strftime('%Y-%m-%d')}.json", orient="records", lines=True
|
133 |
+
# )
|
134 |
|
135 |
# return a list of dictionaries
|
136 |
return df.to_dict(orient="records")
|
|
|
|
|
|
|
|
main.py
CHANGED
@@ -193,7 +193,7 @@ async def search_datasets(
|
|
193 |
conn.close()
|
194 |
|
195 |
|
196 |
-
|
197 |
-
|
198 |
|
199 |
-
|
|
|
193 |
conn.close()
|
194 |
|
195 |
|
196 |
+
if __name__ == "__main__":
|
197 |
+
import uvicorn
|
198 |
|
199 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|