Spaces:
Running
Running
hysts
commited on
Commit
•
49bdf36
1
Parent(s):
48d777b
Make the second stage model available
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ FOOTER = '<img id="visitor-badge" alt="visitor badge" src="https://visitor-badge
|
|
19 |
|
20 |
|
21 |
def main():
|
22 |
-
only_first_stage =
|
23 |
model = AppModel(only_first_stage)
|
24 |
|
25 |
with gr.Blocks(css='style.css') as demo:
|
@@ -38,7 +38,7 @@ def main():
|
|
38 |
label='Seed')
|
39 |
only_first_stage = gr.Checkbox(
|
40 |
label='Only First Stage',
|
41 |
-
value=
|
42 |
visible=not only_first_stage)
|
43 |
run_button = gr.Button('Run')
|
44 |
|
|
|
19 |
|
20 |
|
21 |
def main():
|
22 |
+
only_first_stage = False
|
23 |
model = AppModel(only_first_stage)
|
24 |
|
25 |
with gr.Blocks(css='style.css') as demo:
|
|
|
38 |
label='Seed')
|
39 |
only_first_stage = gr.Checkbox(
|
40 |
label='Only First Stage',
|
41 |
+
value=True,
|
42 |
visible=not only_first_stage)
|
43 |
run_button = gr.Button('Run')
|
44 |
|
model.py
CHANGED
@@ -62,8 +62,8 @@ if os.getenv('SYSTEM') == 'spaces':
|
|
62 |
|
63 |
download_and_extract_icetk_models()
|
64 |
download_and_extract_cogvideo_models('cogvideo-stage1.zip')
|
65 |
-
|
66 |
-
|
67 |
|
68 |
os.environ['SAT_HOME'] = '/home/user/app/pretrained'
|
69 |
|
@@ -677,7 +677,7 @@ def get_default_args() -> argparse.Namespace:
|
|
677 |
'--batch-size',
|
678 |
'1',
|
679 |
'--max-inference-batch-size',
|
680 |
-
'
|
681 |
]
|
682 |
args = get_args(args_list)
|
683 |
args = argparse.Namespace(**vars(args), **vars(known))
|
@@ -779,7 +779,7 @@ class Model:
|
|
779 |
path = auto_create('cogview2-dsr', path=None)
|
780 |
dsr = DirectSuperResolution(self.args,
|
781 |
path,
|
782 |
-
max_bz=
|
783 |
onCUDA=False)
|
784 |
else:
|
785 |
dsr = None
|
|
|
62 |
|
63 |
download_and_extract_icetk_models()
|
64 |
download_and_extract_cogvideo_models('cogvideo-stage1.zip')
|
65 |
+
download_and_extract_cogvideo_models('cogvideo-stage2.zip')
|
66 |
+
download_and_extract_cogview2_models('cogview2-dsr.zip')
|
67 |
|
68 |
os.environ['SAT_HOME'] = '/home/user/app/pretrained'
|
69 |
|
|
|
677 |
'--batch-size',
|
678 |
'1',
|
679 |
'--max-inference-batch-size',
|
680 |
+
'1',
|
681 |
]
|
682 |
args = get_args(args_list)
|
683 |
args = argparse.Namespace(**vars(args), **vars(known))
|
|
|
779 |
path = auto_create('cogview2-dsr', path=None)
|
780 |
dsr = DirectSuperResolution(self.args,
|
781 |
path,
|
782 |
+
max_bz=4,
|
783 |
onCUDA=False)
|
784 |
else:
|
785 |
dsr = None
|