Mar2Ding commited on
Commit
75625d1
·
verified ·
1 Parent(s): a7046e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -4,16 +4,8 @@ from typing import List, Tuple, Optional
4
  import spaces
5
 
6
  # Define the command to be executed
7
- # command = ["python", "setup.py", "build_ext", "--inplace"]
8
- command = ["pip", "install", "--no-build-isolation", "-e", "."]
9
- # Execute the command
10
-
11
- @spaces.GPU(duration=120)
12
- def run_install(command):
13
- result = subprocess.run(command, capture_output=True, text=True)
14
- return result
15
 
16
- result = run_install(command)
17
 
18
  css="""
19
  div#component-18, div#component-25, div#component-35, div#component-41{
@@ -21,15 +13,19 @@ div#component-18, div#component-25, div#component-35, div#component-41{
21
  }
22
  """
23
 
24
- # Print the output and error (if any)
25
- print("Output:\n", result.stdout)
26
- print("Errors:\n", result.stderr)
 
 
 
 
 
 
 
 
 
27
 
28
- # Check if the command was successful
29
- if result.returncode == 0:
30
- print("Command executed successfully.")
31
- else:
32
- print("Command failed with return code:", result.returncode)
33
 
34
  import gradio as gr
35
  from datetime import datetime
@@ -67,7 +63,11 @@ def clear_points(image):
67
  #gr.State() # stored_inference_state
68
  ]
69
 
 
70
  def preprocess_video_in(video_path):
 
 
 
71
 
72
  # Generate a unique ID based on the current date and time
73
  unique_id = datetime.now().strftime('%Y%m%d%H%M%S')
 
4
  import spaces
5
 
6
  # Define the command to be executed
 
 
 
 
 
 
 
 
7
 
8
+ # Execute the command
9
 
10
  css="""
11
  div#component-18, div#component-25, div#component-35, div#component-41{
 
13
  }
14
  """
15
 
16
+ @spaces.GPU(duration=120)
17
+ def run_install(command):
18
+ result = subprocess.run(command, capture_output=True, text=True)
19
+ # Print the output and error (if any)
20
+ print("Output:\n", result.stdout)
21
+ print("Errors:\n", result.stderr)
22
+
23
+ # Check if the command was successful
24
+ if result.returncode == 0:
25
+ print("Command executed successfully.")
26
+ else:
27
+ print("Command failed with return code:", result.returncode)
28
 
 
 
 
 
 
29
 
30
  import gradio as gr
31
  from datetime import datetime
 
63
  #gr.State() # stored_inference_state
64
  ]
65
 
66
+ @spaces.GPU(duration=120)
67
  def preprocess_video_in(video_path):
68
+ # command = ["python", "setup.py", "build_ext", "--inplace"]
69
+ command = ["pip", "install", "--no-build-isolation", "-e", "."]
70
+ run_install(command)
71
 
72
  # Generate a unique ID based on the current date and time
73
  unique_id = datetime.now().strftime('%Y%m%d%H%M%S')