Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,18 @@
|
|
1 |
import subprocess
|
|
|
2 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
from flask import Flask, send_from_directory
|
4 |
|
5 |
# Clone the Mario game repository
|
|
|
1 |
import subprocess
|
2 |
+
import sys
|
3 |
import gradio as gr
|
4 |
+
|
5 |
+
# Install Flask if not already installed
|
6 |
+
def install_flask():
|
7 |
+
try:
|
8 |
+
import flask
|
9 |
+
except ImportError:
|
10 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "flask"], check=True)
|
11 |
+
|
12 |
+
# Install Flask on startup
|
13 |
+
install_flask()
|
14 |
+
|
15 |
+
# Now import Flask
|
16 |
from flask import Flask, send_from_directory
|
17 |
|
18 |
# Clone the Mario game repository
|