Spaces:
Sleeping
Sleeping
Update utilities/setup.py
Browse files- utilities/setup.py +0 -18
utilities/setup.py
CHANGED
@@ -4,24 +4,6 @@ from datasets import load_dataset
|
|
4 |
|
5 |
class get_files:
|
6 |
|
7 |
-
def predefined_dataset(dataset_name):
|
8 |
-
global dataset # bad practice, I know... But just bear with me. Will later update to state dict.
|
9 |
-
dataset = load_dataset(dataset_name, split = "train")
|
10 |
-
return 'Successfully loaded dataset'
|
11 |
-
|
12 |
-
def uploaded_dataset(file):
|
13 |
-
global dataset # bad practice, I know... But just bear with me. Will later update to state dict.
|
14 |
-
dataset = []
|
15 |
-
if file is None:
|
16 |
-
return "File not found. Please upload the file again."
|
17 |
-
try:
|
18 |
-
with open(file,'r') as file:
|
19 |
-
for line in file:
|
20 |
-
dataset.append(json.loads(line.strip()))
|
21 |
-
return "File retrieved."
|
22 |
-
except FileNotFoundError:
|
23 |
-
return "File not found. Please upload the file again."
|
24 |
-
|
25 |
def load_markdown_file(file_path):
|
26 |
try:
|
27 |
with open(file_path, 'r') as f:
|
|
|
4 |
|
5 |
class get_files:
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
def load_markdown_file(file_path):
|
8 |
try:
|
9 |
with open(file_path, 'r') as f:
|