Spaces:
Sleeping
Sleeping
temp change to debug state
Browse files
app.py
CHANGED
|
@@ -134,21 +134,26 @@ def text_to_3d(
|
|
| 134 |
)
|
| 135 |
|
| 136 |
# REMOVED: Video rendering logic moved to render_preview_video
|
| 137 |
-
# video = render_utils.render_video(outputs['gaussian'][0], num_frames=120)['color']
|
| 138 |
-
# video_geo = render_utils.render_video(outputs['mesh'][0], num_frames=120)['normal']
|
| 139 |
-
# video = [np.concatenate([video[i], video_geo[i]], axis=1) for i in range(len(video))]
|
| 140 |
-
# video_path = os.path.join(user_dir, 'sample.mp4')
|
| 141 |
-
# imageio.mimsave(video_path, video, fps=15)
|
| 142 |
|
| 143 |
# Create the state object and ensure it's JSON serializable for API calls
|
| 144 |
state = pack_state(outputs['gaussian'][0], outputs['mesh'][0])
|
| 145 |
# Convert to serializable format
|
| 146 |
serializable_state = json.loads(json.dumps(state, cls=NumpyEncoder))
|
| 147 |
|
| 148 |
-
print(f"[{req.session_hash}] text_to_3d completed.
|
| 149 |
|
| 150 |
torch.cuda.empty_cache()
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
|
| 153 |
# --- NEW FUNCTION ---
|
| 154 |
@spaces.GPU
|
|
|
|
| 134 |
)
|
| 135 |
|
| 136 |
# REMOVED: Video rendering logic moved to render_preview_video
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
|
| 138 |
# Create the state object and ensure it's JSON serializable for API calls
|
| 139 |
state = pack_state(outputs['gaussian'][0], outputs['mesh'][0])
|
| 140 |
# Convert to serializable format
|
| 141 |
serializable_state = json.loads(json.dumps(state, cls=NumpyEncoder))
|
| 142 |
|
| 143 |
+
print(f"[{req.session_hash}] text_to_3d completed. Intended state generated.") # Add logging
|
| 144 |
|
| 145 |
torch.cuda.empty_cache()
|
| 146 |
+
|
| 147 |
+
# --- TEMPORARY DEBUGGING ---
|
| 148 |
+
# Instead of returning the complex state, return a simple dictionary.
|
| 149 |
+
# This tests if the API mechanism itself can return *any* data.
|
| 150 |
+
# REMEMBER TO REVERT THIS AFTER TESTING!
|
| 151 |
+
print("[DEBUG] Returning simple dict for API test.")
|
| 152 |
+
return {"status": "test_success", "received_prompt": prompt}
|
| 153 |
+
# --- END TEMPORARY DEBUGGING ---
|
| 154 |
+
|
| 155 |
+
# Original return line (commented out for test):
|
| 156 |
+
# return serializable_state # MODIFIED: Return only state
|
| 157 |
|
| 158 |
# --- NEW FUNCTION ---
|
| 159 |
@spaces.GPU
|