CineAI commited on
Commit
d1e341b
·
verified ·
1 Parent(s): 8f12571

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -25
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
- 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
  # --- 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 = """