Update JGLUE.py
Browse filesspecify default encoding as "utf-8"
JGLUE.py
CHANGED
|
@@ -294,7 +294,7 @@ class JGLUE(ds.GeneratorBasedBuilder):
|
|
| 294 |
if file_path is None:
|
| 295 |
raise ValueError(f"Invalid argument for {self.config.name}")
|
| 296 |
|
| 297 |
-
with open(file_path, "r") as rf:
|
| 298 |
json_data = json.load(rf)
|
| 299 |
|
| 300 |
for json_dict in json_data["data"]:
|
|
@@ -326,7 +326,7 @@ class JGLUE(ds.GeneratorBasedBuilder):
|
|
| 326 |
if file_path is None:
|
| 327 |
raise ValueError(f"Invalid argument for {self.config.name}")
|
| 328 |
|
| 329 |
-
with open(file_path, "r") as rf:
|
| 330 |
for i, line in enumerate(rf):
|
| 331 |
json_dict = json.loads(line)
|
| 332 |
yield i, json_dict
|
|
@@ -335,7 +335,7 @@ class JGLUE(ds.GeneratorBasedBuilder):
|
|
| 335 |
if file_path is None:
|
| 336 |
raise ValueError(f"Invalid argument for {self.config.name}")
|
| 337 |
|
| 338 |
-
with open(file_path, "r") as rf:
|
| 339 |
for i, line in enumerate(rf):
|
| 340 |
json_dict = json.loads(line)
|
| 341 |
yield i, json_dict
|
|
|
|
| 294 |
if file_path is None:
|
| 295 |
raise ValueError(f"Invalid argument for {self.config.name}")
|
| 296 |
|
| 297 |
+
with open(file_path, "r", encoding="utf-8") as rf:
|
| 298 |
json_data = json.load(rf)
|
| 299 |
|
| 300 |
for json_dict in json_data["data"]:
|
|
|
|
| 326 |
if file_path is None:
|
| 327 |
raise ValueError(f"Invalid argument for {self.config.name}")
|
| 328 |
|
| 329 |
+
with open(file_path, "r", encoding="utf-8") as rf:
|
| 330 |
for i, line in enumerate(rf):
|
| 331 |
json_dict = json.loads(line)
|
| 332 |
yield i, json_dict
|
|
|
|
| 335 |
if file_path is None:
|
| 336 |
raise ValueError(f"Invalid argument for {self.config.name}")
|
| 337 |
|
| 338 |
+
with open(file_path, "r", encoding="utf-8") as rf:
|
| 339 |
for i, line in enumerate(rf):
|
| 340 |
json_dict = json.loads(line)
|
| 341 |
yield i, json_dict
|