Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,6 +46,7 @@ class get_datasets:
|
|
46 |
return dataset, 'Successfully loaded dataset'
|
47 |
|
48 |
def uploaded_dataset(file):
|
|
|
49 |
dataset = []
|
50 |
if file is None:
|
51 |
return "File not found. Please upload the file again."
|
@@ -54,7 +55,6 @@ class get_datasets:
|
|
54 |
for line in file:
|
55 |
dataset.append(json.loads(line.strip()))
|
56 |
print(dataset[0]['query'])
|
57 |
-
global dataset # bad practice, I know... But just bear with me. Will later update to state dict.
|
58 |
return "File retrieved"
|
59 |
except FileNotFoundError:
|
60 |
return "File not found. Please upload the file again."
|
@@ -132,11 +132,9 @@ def main():
|
|
132 |
dataset_uploaded_load = gr.UploadButton(label="Upload Dataset (.csv, .jsonl, or .txt)",
|
133 |
file_types=[".csv",".jsonl", ".txt"],
|
134 |
visible=False)
|
135 |
-
|
136 |
-
data_field = gr.Textbox(label="Dataset Training Field",
|
137 |
-
value=conf['model']['general']["dataset_text_field"])
|
138 |
-
|
139 |
data_snippet = gr.Markdown()
|
|
|
|
|
140 |
dataset_choice.change(update_visibility.textbox_vis,
|
141 |
dataset_choice,
|
142 |
dataset_predefined)
|
@@ -163,6 +161,8 @@ def main():
|
|
163 |
##### Model Parameter Inputs #####
|
164 |
gr.Markdown("### Model Parameter Selection")
|
165 |
# Parameters
|
|
|
|
|
166 |
max_seq_length = gr.Textbox(label="Maximum sequence length",
|
167 |
value=conf['model']['general']["max_seq_length"])
|
168 |
random_seed = gr.Textbox(label="Seed",
|
|
|
46 |
return dataset, 'Successfully loaded dataset'
|
47 |
|
48 |
def uploaded_dataset(file):
|
49 |
+
global dataset # bad practice, I know... But just bear with me. Will later update to state dict.
|
50 |
dataset = []
|
51 |
if file is None:
|
52 |
return "File not found. Please upload the file again."
|
|
|
55 |
for line in file:
|
56 |
dataset.append(json.loads(line.strip()))
|
57 |
print(dataset[0]['query'])
|
|
|
58 |
return "File retrieved"
|
59 |
except FileNotFoundError:
|
60 |
return "File not found. Please upload the file again."
|
|
|
132 |
dataset_uploaded_load = gr.UploadButton(label="Upload Dataset (.csv, .jsonl, or .txt)",
|
133 |
file_types=[".csv",".jsonl", ".txt"],
|
134 |
visible=False)
|
|
|
|
|
|
|
|
|
135 |
data_snippet = gr.Markdown()
|
136 |
+
|
137 |
+
|
138 |
dataset_choice.change(update_visibility.textbox_vis,
|
139 |
dataset_choice,
|
140 |
dataset_predefined)
|
|
|
161 |
##### Model Parameter Inputs #####
|
162 |
gr.Markdown("### Model Parameter Selection")
|
163 |
# Parameters
|
164 |
+
data_field = gr.Textbox(label="Dataset Training Field Name",
|
165 |
+
value=conf['model']['general']["dataset_text_field"])
|
166 |
max_seq_length = gr.Textbox(label="Maximum sequence length",
|
167 |
value=conf['model']['general']["max_seq_length"])
|
168 |
random_seed = gr.Textbox(label="Seed",
|