feng2022 commited on
Commit
18cc678
1 Parent(s): 7335ad6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -19
app.py CHANGED
@@ -36,22 +36,6 @@ DESCRIPTION = '''This is an unofficial demo for https://github.com/Time-Travel-R
36
  ARTICLE = '<center><img src="https://visitor-badge.glitch.me/badge?page_id=Time-TravelRephotography" alt="visitor badge"/></center>'
37
 
38
  TOKEN = "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"
39
-
40
-
41
- pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
42
-
43
- def parse_args() -> argparse.Namespace:
44
- parser = argparse.ArgumentParser()
45
- parser.add_argument('--device', type=str, default='cpu')
46
- parser.add_argument('--theme', type=str)
47
- parser.add_argument('--live', action='store_true')
48
- parser.add_argument('--share', action='store_true')
49
- parser.add_argument('--port', type=int)
50
- parser.add_argument('--disable-queue',
51
- dest='enable_queue',
52
- action='store_false')
53
- parser.add_argument('--allow-flagging', type=str, default='never')
54
- return parser.parse_args()
55
 
56
  def image_create(input_img):
57
  args = ProjectorArguments().parse(
@@ -77,10 +61,8 @@ def main():
77
  #result = subprocess.check_output(['nvidia-smi'])
78
  args = parse_args()
79
  device = th.device()
80
- func = functools.partial(image_create, device=device)
81
- func = functools.update_wrapper(func, image_create)
82
  iface = gr.Interface(
83
- func,
84
  [
85
  gr.inputs.Number(default=0, label='Seed'),
86
  gr.inputs.Slider(
 
36
  ARTICLE = '<center><img src="https://visitor-badge.glitch.me/badge?page_id=Time-TravelRephotography" alt="visitor badge"/></center>'
37
 
38
  TOKEN = "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"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  def image_create(input_img):
41
  args = ProjectorArguments().parse(
 
61
  #result = subprocess.check_output(['nvidia-smi'])
62
  args = parse_args()
63
  device = th.device()
 
 
64
  iface = gr.Interface(
65
+ image_create,
66
  [
67
  gr.inputs.Number(default=0, label='Seed'),
68
  gr.inputs.Slider(