Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,16 +17,20 @@ def initialize_global_data():
|
|
| 17 |
"""
|
| 18 |
if not os.path.exists(DATA_FILE):
|
| 19 |
ds = load_dataset("gaeunseo/Taskmaster_sample_data", split="train")
|
| 20 |
-
data =
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
return data
|
| 25 |
else:
|
| 26 |
with data_lock:
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
return data
|
| 30 |
|
| 31 |
def load_global_data():
|
| 32 |
with data_lock:
|
|
|
|
| 17 |
"""
|
| 18 |
if not os.path.exists(DATA_FILE):
|
| 19 |
ds = load_dataset("gaeunseo/Taskmaster_sample_data", split="train")
|
| 20 |
+
data = ds.to_pandas()
|
| 21 |
+
# 필요한 컬럼이 없으면 추가합니다.
|
| 22 |
+
if "used" not in data.columns:
|
| 23 |
+
data["used"] = False
|
| 24 |
+
if "overlapping" not in data.columns:
|
| 25 |
+
data["overlapping"] = ""
|
| 26 |
+
if "text" not in data.columns:
|
| 27 |
+
data["text"] = ""
|
| 28 |
+
data.to_csv(DATA_FILE, index=False)
|
| 29 |
return data
|
| 30 |
else:
|
| 31 |
with data_lock:
|
| 32 |
+
df = pd.read_csv(DATA_FILE)
|
| 33 |
+
return df
|
|
|
|
| 34 |
|
| 35 |
def load_global_data():
|
| 36 |
with data_lock:
|