Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -35,22 +35,16 @@ def run_inference(prompt, config):
|
|
35 |
print(f"Inference finished. Time: {time.time() - start}")
|
36 |
return video_path
|
37 |
|
38 |
-
def
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
"
|
46 |
-
|
47 |
-
|
48 |
-
"prompts": [input_text]
|
49 |
-
},
|
50 |
-
"plugin_configs": {}
|
51 |
-
}
|
52 |
-
video_path = run_inference(input_text, config)
|
53 |
-
return video_path
|
54 |
|
55 |
-
|
56 |
-
|
|
|
35 |
print(f"Inference finished. Time: {time.time() - start}")
|
36 |
return video_path
|
37 |
|
38 |
+
def demo_interface():
|
39 |
+
config_path = './configs/config.json'
|
40 |
+
with open(config_path, 'r') as f:
|
41 |
+
config = json.load(f)
|
42 |
+
iface = gr.Interface(
|
43 |
+
fn=lambda prompt: run_inference(prompt, config),
|
44 |
+
inputs="text",
|
45 |
+
outputs="text"
|
46 |
+
)
|
47 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
if __name__ == "__main__":
|
50 |
+
demo_interface()
|