owiedotch commited on
Commit
f77813c
·
verified ·
1 Parent(s): 6381c79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import os
 
2
  import torch
3
  import gradio as gr
4
  import spaces
@@ -7,6 +8,7 @@ import numpy as np
7
  from omegaconf import OmegaConf
8
  import requests
9
  from tqdm import tqdm
 
10
 
11
  def download_file(url, filename):
12
  response = requests.get(url, stream=True)
@@ -24,6 +26,13 @@ def download_file(url, filename):
24
  progress_bar.update(size)
25
 
26
  def setup_environment():
 
 
 
 
 
 
 
27
  os.makedirs("weights", exist_ok=True)
28
  if not os.path.exists("weights/real-world_ccsr.ckpt"):
29
  print("Downloading model checkpoint...")
 
1
  import os
2
+ import sys
3
  import torch
4
  import gradio as gr
5
  import spaces
 
8
  from omegaconf import OmegaConf
9
  import requests
10
  from tqdm import tqdm
11
+ import subprocess
12
 
13
  def download_file(url, filename):
14
  response = requests.get(url, stream=True)
 
26
  progress_bar.update(size)
27
 
28
  def setup_environment():
29
+ if not os.path.exists("CCSR"):
30
+ print("Cloning CCSR repository...")
31
+ subprocess.run(["git", "clone", "-b", "dev", "https://github.com/camenduru/CCSR.git"])
32
+
33
+ os.chdir("CCSR")
34
+ sys.path.append(os.getcwd())
35
+
36
  os.makedirs("weights", exist_ok=True)
37
  if not os.path.exists("weights/real-world_ccsr.ckpt"):
38
  print("Downloading model checkpoint...")