Spaces:
Sleeping
Sleeping
nileshhanotia
commited on
Commit
•
2882051
1
Parent(s):
59782fa
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
import os
|
3 |
import json
|
4 |
import random
|
@@ -18,21 +17,12 @@ def set_git_config():
|
|
18 |
try:
|
19 |
subprocess.run(['git', 'config', '--global', 'user.email', '[email protected]'], check=True)
|
20 |
subprocess.run(['git', 'config', '--global', 'user.name', 'Nilesh'], check=True)
|
|
|
21 |
except subprocess.CalledProcessError as e:
|
22 |
st.error(f"Git configuration error: {str(e)}")
|
23 |
|
24 |
-
set_git_config
|
25 |
-
|
26 |
-
if not os.path.exists(file_path):
|
27 |
-
st.error(f"File not found: {file_path}")
|
28 |
-
return None
|
29 |
-
try:
|
30 |
-
with open(file_path, 'r') as f:
|
31 |
-
data = json.load(f)
|
32 |
-
return data
|
33 |
-
except Exception as e:
|
34 |
-
st.error(f"Error loading dataset: {str(e)}")
|
35 |
-
return None
|
36 |
|
37 |
@st.cache_data
|
38 |
def load_data(file_path):
|
|
|
|
|
1 |
import os
|
2 |
import json
|
3 |
import random
|
|
|
17 |
try:
|
18 |
subprocess.run(['git', 'config', '--global', 'user.email', '[email protected]'], check=True)
|
19 |
subprocess.run(['git', 'config', '--global', 'user.name', 'Nilesh'], check=True)
|
20 |
+
st.success("Git configuration set successfully.")
|
21 |
except subprocess.CalledProcessError as e:
|
22 |
st.error(f"Git configuration error: {str(e)}")
|
23 |
|
24 |
+
# Call set_git_config at the start of the script
|
25 |
+
set_git_config()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
@st.cache_data
|
28 |
def load_data(file_path):
|