Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -267,6 +267,9 @@ def add_text_prefix(text):
|
|
| 267 |
text = f"Please generate a 3D asset based on the prompt I provided: {text}"
|
| 268 |
return gr.update(value=text)
|
| 269 |
|
|
|
|
|
|
|
|
|
|
| 270 |
def token_to_words(token):
|
| 271 |
mesh = "<mesh-start>"
|
| 272 |
for j in range(1024):
|
|
@@ -505,7 +508,6 @@ with gr.Blocks() as demo:
|
|
| 505 |
outputs=[query],
|
| 506 |
cache_examples=True,
|
| 507 |
)
|
| 508 |
-
|
| 509 |
examples_text.dataset.click(
|
| 510 |
fn=add_text,
|
| 511 |
inputs=[chatbot, task_history, query,task_new],
|
|
@@ -515,6 +517,9 @@ with gr.Blocks() as demo:
|
|
| 515 |
label="image-to-3d examples",
|
| 516 |
examples=[os.path.join("examples", i) for i in os.listdir("examples")],
|
| 517 |
inputs=[image_input],
|
|
|
|
|
|
|
|
|
|
| 518 |
examples_per_page = 20,
|
| 519 |
)
|
| 520 |
image_input.change(
|
|
|
|
| 267 |
text = f"Please generate a 3D asset based on the prompt I provided: {text}"
|
| 268 |
return gr.update(value=text)
|
| 269 |
|
| 270 |
+
def add_image_prefix(image_path):
|
| 271 |
+
return image_path,gr.update(value="Generate a 3D mesh from the provided image.")
|
| 272 |
+
|
| 273 |
def token_to_words(token):
|
| 274 |
mesh = "<mesh-start>"
|
| 275 |
for j in range(1024):
|
|
|
|
| 508 |
outputs=[query],
|
| 509 |
cache_examples=True,
|
| 510 |
)
|
|
|
|
| 511 |
examples_text.dataset.click(
|
| 512 |
fn=add_text,
|
| 513 |
inputs=[chatbot, task_history, query,task_new],
|
|
|
|
| 517 |
label="image-to-3d examples",
|
| 518 |
examples=[os.path.join("examples", i) for i in os.listdir("examples")],
|
| 519 |
inputs=[image_input],
|
| 520 |
+
fn=add_image_prefix,
|
| 521 |
+
outputs=[image_input,query],
|
| 522 |
+
cache_examples=True,
|
| 523 |
examples_per_page = 20,
|
| 524 |
)
|
| 525 |
image_input.change(
|