Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -53,6 +53,18 @@ def huggingface_login():
|
|
53 |
raise
|
54 |
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
def main():
|
57 |
"""
|
58 |
Main function to perform all operations.
|
@@ -68,6 +80,9 @@ def main():
|
|
68 |
# Log in to Hugging Face
|
69 |
huggingface_login()
|
70 |
|
|
|
|
|
|
|
71 |
print("All operations completed successfully.")
|
72 |
except Exception as e:
|
73 |
print(f"An error occurred: {e}")
|
|
|
53 |
raise
|
54 |
|
55 |
|
56 |
+
def start_gradio_demo():
|
57 |
+
"""
|
58 |
+
Start the Gradio demo.
|
59 |
+
"""
|
60 |
+
try:
|
61 |
+
print("Starting Gradio demo...")
|
62 |
+
subprocess.run(["python", "-m", "src.demo.gradio_demo", "--hf", "--downsample"], check=True)
|
63 |
+
except subprocess.CalledProcessError as e:
|
64 |
+
print(f"Error starting Gradio demo: {e}")
|
65 |
+
raise
|
66 |
+
|
67 |
+
|
68 |
def main():
|
69 |
"""
|
70 |
Main function to perform all operations.
|
|
|
80 |
# Log in to Hugging Face
|
81 |
huggingface_login()
|
82 |
|
83 |
+
# Start the Gradio demo
|
84 |
+
start_gradio_demo()
|
85 |
+
|
86 |
print("All operations completed successfully.")
|
87 |
except Exception as e:
|
88 |
print(f"An error occurred: {e}")
|