YaohuiW commited on
Commit
d76cf4f
·
verified ·
1 Parent(s): 685fe6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -3
app.py CHANGED
@@ -26,6 +26,17 @@ import spaces
26
  # from gradio_tabs.animation import animation
27
  # from gradio_tabs.vid_edit import vid_edit
28
 
 
 
 
 
 
 
 
 
 
 
 
29
  def load_file(path):
30
 
31
  with open(path, 'r', encoding='utf-8') as f:
@@ -63,10 +74,10 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
63
 
64
  with gr.Row():
65
  with gr.Tabs():
66
- #from gradio_tabs.animation import animation
67
  from gradio_tabs.vid_edit import vid_edit
68
- #animation()
69
- vid_edit()
70
  #load_tabs()
71
  #animation()
72
  #vid_edit()
 
26
  # from gradio_tabs.animation import animation
27
  # from gradio_tabs.vid_edit import vid_edit
28
 
29
+ extensions_dir = "./torch_extension/"
30
+ os.environ["TORCH_EXTENSIONS_DIR"] = extensions_dir
31
+
32
+ from networks.generator import Generator
33
+
34
+ device = torch.device("cuda")
35
+ gen = Generator(size=512, motion_dim=40, scale=2).to(device)
36
+ gen.load_state_dict(torch.hub.load_state_dict_from_url(f"https://huggingface.co/YaohuiW/LIA-X/resolve/main/lia-x.pt"))
37
+ gen.eval()
38
+
39
+
40
  def load_file(path):
41
 
42
  with open(path, 'r', encoding='utf-8') as f:
 
74
 
75
  with gr.Row():
76
  with gr.Tabs():
77
+ from gradio_tabs.animation import animation
78
  from gradio_tabs.vid_edit import vid_edit
79
+ animation(gen)
80
+ vid_edit(gen)
81
  #load_tabs()
82
  #animation()
83
  #vid_edit()