Shap-E / app.py
hysts's picture
hysts HF Staff
Move css_paths to launch() and drop dead #duplicate-button CSS
7f6e908
Raw
History Blame Contribute Delete
737 Bytes
#!/usr/bin/env python
import gradio as gr
import torch
from app_image_to_3d import create_demo as create_demo_image_to_3d
from app_text_to_3d import create_demo as create_demo_text_to_3d
from model import Model
DESCRIPTION = "# [Shap-E](https://github.com/openai/shap-e)"
if not torch.cuda.is_available():
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
model = Model()
with gr.Blocks() as demo:
gr.Markdown(DESCRIPTION)
with gr.Tabs():
with gr.Tab(label="Text to 3D"):
create_demo_text_to_3d(model)
with gr.Tab(label="Image to 3D"):
create_demo_image_to_3d(model)
if __name__ == "__main__":
demo.launch(mcp_server=True, css_paths="style.css")