smallville / app.py
CazC's picture
Add subprocess.run to install torchmcubes package
45d0e7b
raw
history blame
494 Bytes
import gradio as gr
from worker import worker # import the worker function
import subprocess
import shlex
subprocess.run(shlex.split('pip install wheel/torchmcubes-0.1.0-cp310-cp310-linux_x86_64.whl'))
def greet(name):
return "Hello " + name + "!!"
def kickoff_worker():
worker() # call the worker function
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()
print("Launching worker...")
kickoff_worker() # kickoff the worker after launching the interface