Spaces:
Sleeping
Sleeping
edbeeching
commited on
Commit
·
00f53b5
1
Parent(s):
f32647d
fix num samples
Browse files
app.py
CHANGED
|
@@ -67,6 +67,7 @@ def validate_request(request: GenerationRequest):
|
|
| 67 |
|
| 68 |
# check that the number of samples is less than MAX_SAMPLES
|
| 69 |
if input_dataset_info.splits[request.input_dataset_split].num_examples > MAX_SAMPLES:
|
|
|
|
| 70 |
raise Exception(f"Dataset split {request.input_dataset_split} in dataset {request.input_dataset_name} exceeds max sample limit of {MAX_SAMPLES}.")
|
| 71 |
|
| 72 |
# check the prompt column exists in the dataset
|
|
@@ -134,8 +135,8 @@ def add_request_to_db(request: GenerationRequest):
|
|
| 134 |
"output_dataset_token": request.output_dataset_token,
|
| 135 |
"username": request.username,
|
| 136 |
"email": request.email,
|
| 137 |
-
"num_output_examples":
|
| 138 |
-
"private":
|
| 139 |
}
|
| 140 |
|
| 141 |
supabase.table("gen-requests").insert(data).execute()
|
|
|
|
| 67 |
|
| 68 |
# check that the number of samples is less than MAX_SAMPLES
|
| 69 |
if input_dataset_info.splits[request.input_dataset_split].num_examples > MAX_SAMPLES:
|
| 70 |
+
request.num_output_examples = input_dataset_info.splits[request.input_dataset_split].num_examples
|
| 71 |
raise Exception(f"Dataset split {request.input_dataset_split} in dataset {request.input_dataset_name} exceeds max sample limit of {MAX_SAMPLES}.")
|
| 72 |
|
| 73 |
# check the prompt column exists in the dataset
|
|
|
|
| 135 |
"output_dataset_token": request.output_dataset_token,
|
| 136 |
"username": request.username,
|
| 137 |
"email": request.email,
|
| 138 |
+
"num_output_examples": request.num_output_examples,
|
| 139 |
+
"private": request.private,
|
| 140 |
}
|
| 141 |
|
| 142 |
supabase.table("gen-requests").insert(data).execute()
|