Spaces:
Runtime error
Runtime error
Commit ·
8db7ccf
1
Parent(s): 7dfcf5d
added new guard railes
Browse files
app.py
CHANGED
|
@@ -690,7 +690,7 @@ if __name__ == "__main__":
|
|
| 690 |
)
|
| 691 |
|
| 692 |
with gr.Row():
|
| 693 |
-
guidelines = gr.Textbox(lines=2, label="Readme",value="Just a heads-up! 💡 You can tell the agent to finalize the plan at the any stage of the process to immediately start generating model. 💡 It takes an average of 300 seconds to generate a 3d model. 💡 Click the logs button to view the progress. 💡 If the header component isnt visible on screen please resize your browser window twice.✨")
|
| 694 |
|
| 695 |
with gr.Row():
|
| 696 |
with gr.Column(scale=2):
|
|
|
|
| 690 |
)
|
| 691 |
|
| 692 |
with gr.Row():
|
| 693 |
+
guidelines = gr.Textbox(lines=2, label="ℹ️Readmeℹ️",value="Just a heads-up! 💡 You can tell the agent to finalize the plan at the any stage of the process to immediately start generating model. 💡 It takes an average of 300 seconds to generate a 3d model. 💡 Click the logs button to view the progress. 💡 If the header component isnt visible on screen please resize your browser window twice. 💡New chat need to be started once a 3d model has been generated. ✨")
|
| 694 |
|
| 695 |
with gr.Row():
|
| 696 |
with gr.Column(scale=2):
|
graph.py
CHANGED
|
@@ -792,7 +792,7 @@ ACCURATE PROMPT FOR MODEL GENERATING: [Your final single-paragraph prompt here]
|
|
| 792 |
# Check for finalization signalif "finalize_idea:" in content:
|
| 793 |
if "ACCURATE PROMPT FOR MODEL GENERATING" in content:
|
| 794 |
dalle_prompt_text = content.replace("ACCURATE PROMPT FOR MODEL GENERATING:", "").strip()
|
| 795 |
-
print(f"\n🤖🤖🤖🤖Extracted DALL-E prompt: {dalle_prompt_text}")
|
| 796 |
|
| 797 |
generated_image_url = None
|
| 798 |
generated_3d_model_url = None # This will store the final 3D model URL
|
|
@@ -988,7 +988,7 @@ ACCURATE PROMPT FOR MODEL GENERATING: [Your final single-paragraph prompt here]
|
|
| 988 |
# e.g., "quality": "hd", "style": "vivid"
|
| 989 |
}
|
| 990 |
|
| 991 |
-
print(f"\n🤖🤖🤖🤖
|
| 992 |
async with aiohttp.ClientSession() as session:
|
| 993 |
try:
|
| 994 |
async with session.post(dalle_api_url, headers=dalle_headers, json=dalle_payload) as dalle_response:
|
|
@@ -1050,7 +1050,7 @@ async def generate_3d_node(state: GraphProcessingState, config=None):
|
|
| 1050 |
# print("No image_url_for_3d found in state.")
|
| 1051 |
# return {"messages": [AIMessage(content="No image URL found for 3D generation.")]}
|
| 1052 |
|
| 1053 |
-
print(f"Using generated image_url: {state.generated_image_url_from_dalle}")
|
| 1054 |
|
| 1055 |
# 2. Define API endpoint and parameters
|
| 1056 |
api_base_url = "https://wishwa-code--trellis-3d-model-generate.modal.run/"
|
|
@@ -1080,7 +1080,7 @@ async def generate_3d_node(state: GraphProcessingState, config=None):
|
|
| 1080 |
}
|
| 1081 |
|
| 1082 |
# 3. Attempt generation with retries
|
| 1083 |
-
print(f"
|
| 1084 |
try:
|
| 1085 |
# Note: The API call can take a long time (1.5 mins in your curl example)
|
| 1086 |
# Ensure your HTTP client timeout is sufficient.
|
|
|
|
| 792 |
# Check for finalization signalif "finalize_idea:" in content:
|
| 793 |
if "ACCURATE PROMPT FOR MODEL GENERATING" in content:
|
| 794 |
dalle_prompt_text = content.replace("ACCURATE PROMPT FOR MODEL GENERATING:", "").strip()
|
| 795 |
+
# print(f"\n🤖🤖🤖🤖Extracted DALL-E prompt: {dalle_prompt_text}")
|
| 796 |
|
| 797 |
generated_image_url = None
|
| 798 |
generated_3d_model_url = None # This will store the final 3D model URL
|
|
|
|
| 988 |
# e.g., "quality": "hd", "style": "vivid"
|
| 989 |
}
|
| 990 |
|
| 991 |
+
print(f"\n🤖🤖🤖🤖Generating image using DALL-E with this prompt: {dalle_prompt_text}")
|
| 992 |
async with aiohttp.ClientSession() as session:
|
| 993 |
try:
|
| 994 |
async with session.post(dalle_api_url, headers=dalle_headers, json=dalle_payload) as dalle_response:
|
|
|
|
| 1050 |
# print("No image_url_for_3d found in state.")
|
| 1051 |
# return {"messages": [AIMessage(content="No image URL found for 3D generation.")]}
|
| 1052 |
|
| 1053 |
+
# print(f"Using generated image_url: {state.generated_image_url_from_dalle}")
|
| 1054 |
|
| 1055 |
# 2. Define API endpoint and parameters
|
| 1056 |
api_base_url = "https://wishwa-code--trellis-3d-model-generate.modal.run/"
|
|
|
|
| 1080 |
}
|
| 1081 |
|
| 1082 |
# 3. Attempt generation with retries
|
| 1083 |
+
print(f"\n 🧙🧙 Calling 3d moded generation API for the { state.drawing_attempts} time. Max attempts : {max_attempts}")
|
| 1084 |
try:
|
| 1085 |
# Note: The API call can take a long time (1.5 mins in your curl example)
|
| 1086 |
# Ensure your HTTP client timeout is sufficient.
|