clr commited on
Commit
1022a63
·
1 Parent(s): a2e2887

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -1,12 +1,19 @@
1
- import gradio as gr
 
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
8
 
 
 
9
 
 
 
10
 
11
  #https://mercury-docs.readthedocs.io/en/latest/deploy/hugging-face-spaces/
12
  #https://huggingface.co/spaces/pplonski/deploy-mercury
 
1
+ import os
2
+ from dotenv import load_dotenv
3
+ from subprocess import Popen
4
+ load_dotenv()
5
 
6
+ command = ["mercury", "run", f"0.0.0.0:{os.environ.get('PORT', 7860)}"]
7
+ worker = Popen(command)
8
+ worker.wait()
9
 
10
+ #import gradio as gr
 
11
 
12
+ #def greet(name):
13
+ # return "Hello " + name + "!!"
14
 
15
+ #iface = gr.Interface(fn=greet, inputs="text", outputs="text")
16
+ #iface.launch()
17
 
18
  #https://mercury-docs.readthedocs.io/en/latest/deploy/hugging-face-spaces/
19
  #https://huggingface.co/spaces/pplonski/deploy-mercury