Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,36 +1,40 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
-
import subprocess
|
| 4 |
import pandas as pd
|
| 5 |
from PIL import Image
|
| 6 |
import folium
|
| 7 |
|
| 8 |
# --- Setup: Clone the repository for helper classes ---
|
| 9 |
# This will only run once to fetch the necessary source code.
|
| 10 |
-
REPO_DIR = "TheAmateur"
|
| 11 |
-
if not os.path.exists(REPO_DIR):
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
# Now that the repo is cloned, we can import the necessary modules
|
| 26 |
-
try:
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
except ImportError as e:
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# --- Constants and System Prompt ---
|
| 36 |
SYSTEM_PROMPT = """
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
+
# import subprocess
|
| 4 |
import pandas as pd
|
| 5 |
from PIL import Image
|
| 6 |
import folium
|
| 7 |
|
| 8 |
# --- Setup: Clone the repository for helper classes ---
|
| 9 |
# This will only run once to fetch the necessary source code.
|
| 10 |
+
# REPO_DIR = "TheAmateur"
|
| 11 |
+
# if not os.path.exists(REPO_DIR):
|
| 12 |
+
# try:
|
| 13 |
+
# print(f"Cloning repository into ./{REPO_DIR}...")
|
| 14 |
+
# subprocess.run(
|
| 15 |
+
# ["git", "clone", "https://github.com/OrlovVladislav/TheAmateur.git"],
|
| 16 |
+
# check=True,
|
| 17 |
+
# capture_output=True,
|
| 18 |
+
# text=True
|
| 19 |
+
# )
|
| 20 |
+
# print("Repository cloned successfully.")
|
| 21 |
+
# except subprocess.CalledProcessError as e:
|
| 22 |
+
# print(f"Error cloning repository: {e.stderr}")
|
| 23 |
+
# exit() # Exit if cloning fails, as the app cannot run without it.
|
| 24 |
+
|
| 25 |
+
# # Now that the repo is cloned, we can import the necessary modules
|
| 26 |
+
# try:
|
| 27 |
+
# from TheAmateur.src.rainbolt_parody import RainboltParody
|
| 28 |
+
# from TheAmateur.src.map_gen import MapGenerator
|
| 29 |
+
# from TheAmateur.src.geo_info import GeoInfo
|
| 30 |
+
# except ImportError as e:
|
| 31 |
+
# print(f"Failed to import from the cloned repository: {e}")
|
| 32 |
+
# exit()
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
from src.rainbolt_parody import RainboltParody
|
| 36 |
+
from src.map_gen import MapGenerator
|
| 37 |
+
from src.geo_info import GeoInfo
|
| 38 |
|
| 39 |
# --- Constants and System Prompt ---
|
| 40 |
SYSTEM_PROMPT = """
|