Update fix langlinks.py
Browse files- fix langlinks.py +6 -5
fix langlinks.py
CHANGED
@@ -68,6 +68,8 @@ for tab in tqdm.tqdm(data):
|
|
68 |
data_lists["cats_2000_contry"][key3] = value3
|
69 |
|
70 |
|
|
|
|
|
71 |
for x, data_list in data_lists.items():
|
72 |
data_list = [{"en": key, "ar": value} for key, value in data_list.items()]
|
73 |
|
@@ -75,14 +77,13 @@ for x, data_list in data_lists.items():
|
|
75 |
with open(f"{x}.json", "w", encoding="utf-8") as f:
|
76 |
json.dump(data_list, f, ensure_ascii=False, indent=4)
|
77 |
|
|
|
|
|
|
|
|
|
78 |
upload_file(
|
79 |
path_or_fileobj=f"{x}.json", # اسم الملف الذي تم حفظه
|
80 |
path_in_repo=f"{x}.json", # المسار داخل المستودع
|
81 |
repo_id="Ibrahemqasim/enwiki_to_arwiki_categories", # معرف المستودع
|
82 |
# repo_type="dataset", # نوع المستودع (نستخدم dataset للملفات)
|
83 |
)
|
84 |
-
|
85 |
-
print(f"______________")
|
86 |
-
print(f"file: {x} uploaded successfully!")
|
87 |
-
print(f"{len(data)=}.")
|
88 |
-
print(f"{len(data_list)} rows uploaded.")
|
|
|
68 |
data_lists["cats_2000_contry"][key3] = value3
|
69 |
|
70 |
|
71 |
+
print(f"all data len: {len(data):,}.")
|
72 |
+
|
73 |
for x, data_list in data_lists.items():
|
74 |
data_list = [{"en": key, "ar": value} for key, value in data_list.items()]
|
75 |
|
|
|
77 |
with open(f"{x}.json", "w", encoding="utf-8") as f:
|
78 |
json.dump(data_list, f, ensure_ascii=False, indent=4)
|
79 |
|
80 |
+
print("______________")
|
81 |
+
print(f"file: {x} uploaded successfully!")
|
82 |
+
print(f"len of {x} : {len(data_list)}.")
|
83 |
+
|
84 |
upload_file(
|
85 |
path_or_fileobj=f"{x}.json", # اسم الملف الذي تم حفظه
|
86 |
path_in_repo=f"{x}.json", # المسار داخل المستودع
|
87 |
repo_id="Ibrahemqasim/enwiki_to_arwiki_categories", # معرف المستودع
|
88 |
# repo_type="dataset", # نوع المستودع (نستخدم dataset للملفات)
|
89 |
)
|
|
|
|
|
|
|
|
|
|