Spaces:
Sleeping
Sleeping
s6bhatti commited on
Commit ·
5dc2d82
1
Parent(s): 1da39ce
Update error when root page has only a single element
Browse files
blueprints/architect.py
CHANGED
|
@@ -332,7 +332,7 @@ def generate_blueprint(description, force_json=False, temperature=0.8, top_p=0.3
|
|
| 332 |
@model_validator(mode='after')
|
| 333 |
def validate_children(cls, values):
|
| 334 |
if len(values.blueprint.children) <= 1:
|
| 335 |
-
raise ValueError("The root Page (blueprint) must have more than one child.")
|
| 336 |
return values
|
| 337 |
|
| 338 |
|
|
|
|
| 332 |
@model_validator(mode='after')
|
| 333 |
def validate_children(cls, values):
|
| 334 |
if len(values.blueprint.children) <= 1:
|
| 335 |
+
raise ValueError("The root Page (blueprint) must have more than one child. Note: DO NOT JUST GENERATE A SINGULAR CALLOUT BOX IN A PAGE AS YOUR BLUEPRINT. THIS IS VERY IMPORTANT.")
|
| 336 |
return values
|
| 337 |
|
| 338 |
|
blueprints/schema.py
CHANGED
|
@@ -236,7 +236,7 @@ class OpenAIResponse(BaseModel):
|
|
| 236 |
@model_validator(mode='after')
|
| 237 |
def validate_children(cls, values):
|
| 238 |
if len(values.blueprint.children) <= 1:
|
| 239 |
-
raise ValueError("The root Page (blueprint) must have more than one child.")
|
| 240 |
return values
|
| 241 |
|
| 242 |
|
|
|
|
| 236 |
@model_validator(mode='after')
|
| 237 |
def validate_children(cls, values):
|
| 238 |
if len(values.blueprint.children) <= 1:
|
| 239 |
+
raise ValueError("The root Page (blueprint) must have more than one child. Note: DO NOT JUST GENERATE A SINGULAR CALLOUT BOX IN A PAGE AS YOUR BLUEPRINT. THIS IS VERY IMPORTANT.")
|
| 240 |
return values
|
| 241 |
|
| 242 |
|
data/{finetuning_data_cot_v11.jsonl → finetuning_data_cot_v12.jsonl}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/process_data.py
CHANGED
|
@@ -265,7 +265,7 @@ class OpenAIResponse(BaseModel):
|
|
| 265 |
@model_validator(mode='after')
|
| 266 |
def validate_children(cls, values):
|
| 267 |
if len(values.blueprint.children) <= 1:
|
| 268 |
-
raise ValueError("The root Page (blueprint) must have more than one child.")
|
| 269 |
return values
|
| 270 |
|
| 271 |
|
|
@@ -298,6 +298,6 @@ for _, row in blueprints_df.iterrows():
|
|
| 298 |
}
|
| 299 |
messages.append(entry)
|
| 300 |
|
| 301 |
-
with open("
|
| 302 |
for message in messages:
|
| 303 |
print(json.dumps(message, ensure_ascii=False), file=f)
|
|
|
|
| 265 |
@model_validator(mode='after')
|
| 266 |
def validate_children(cls, values):
|
| 267 |
if len(values.blueprint.children) <= 1:
|
| 268 |
+
raise ValueError("The root Page (blueprint) must have more than one child. Note: DO NOT JUST GENERATE A SINGULAR CALLOUT BOX IN A PAGE AS YOUR BLUEPRINT. THIS IS VERY IMPORTANT.")
|
| 269 |
return values
|
| 270 |
|
| 271 |
|
|
|
|
| 298 |
}
|
| 299 |
messages.append(entry)
|
| 300 |
|
| 301 |
+
with open("finetuning_data_cot_v12.jsonl", "w") as f:
|
| 302 |
for message in messages:
|
| 303 |
print(json.dumps(message, ensure_ascii=False), file=f)
|