mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-06 10:25:17 +08:00
73e98ddf15
* add required param but None * import torch req, add chunk_length_s import torch requirement for transformers enable inference for longer audio files * fix compononte initialization * input number is float, force int to multipy string * no need for Templates, fix class init * expects array * add requirements.txt for demo * update with cleaner syntax * add sample csv to fraud demo * adapt to new syntax * temp fix for Slider arguments * add dep to requirements * remove gr.Markdown from Interface init * fix default value param name * upgrade deepspeech, download models onstart * use path resolution consistent with other demos * remove redundant demo * add example to interface * fixed plotting issues * plots * deprecated carousel Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
29 lines
650 B
Python
29 lines
650 B
Python
import time
|
|
import gradio as gr
|
|
import os
|
|
|
|
|
|
def load_mesh(mesh_file_name):
|
|
time.sleep(2)
|
|
return mesh_file_name
|
|
|
|
|
|
inputs = gr.Model3D()
|
|
outputs = gr.Model3D(clear_color=[0.8, 0.2, 0.2, 1.0])
|
|
|
|
demo = gr.Interface(
|
|
fn=load_mesh,
|
|
inputs=inputs,
|
|
outputs=outputs,
|
|
examples=[
|
|
[os.path.join(os.path.dirname(__file__), "files/Bunny.obj")],
|
|
[os.path.join(os.path.dirname(__file__), "files/Duck.glb")],
|
|
[os.path.join(os.path.dirname(__file__), "files/Fox.gltf")],
|
|
[os.path.join(os.path.dirname(__file__), "files/face.obj")],
|
|
],
|
|
cache_examples=True,
|
|
)
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch()
|