Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -167,6 +167,16 @@ def create_gradio_interface() -> gr.Interface:
|
|
167 |
)
|
168 |
|
169 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
# Create and launch the interface
|
171 |
iface = create_gradio_interface()
|
172 |
-
iface.launch(
|
|
|
167 |
)
|
168 |
|
169 |
if __name__ == "__main__":
|
170 |
+
# Install Playwright browsers and dependencies
|
171 |
+
import subprocess
|
172 |
+
try:
|
173 |
+
subprocess.run(["playwright", "install"], check=True)
|
174 |
+
subprocess.run(["playwright", "install-deps"], check=True)
|
175 |
+
except subprocess.CalledProcessError as e:
|
176 |
+
print(f"Error installing Playwright dependencies: {e}")
|
177 |
+
except Exception as e:
|
178 |
+
print(f"Unexpected error during setup: {e}")
|
179 |
+
|
180 |
# Create and launch the interface
|
181 |
iface = create_gradio_interface()
|
182 |
+
iface.launch()
|