Spaces:
Runtime error
Runtime error
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -4,14 +4,30 @@ import plotly.graph_objects as go
|
|
4 |
import gradio as gr
|
5 |
import os
|
6 |
|
7 |
-
#
|
8 |
-
|
|
|
9 |
|
10 |
-
#
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
# Clean the data
|
17 |
df = df.dropna(subset=['final_score'])
|
|
|
4 |
import gradio as gr
|
5 |
import os
|
6 |
|
7 |
+
# Debugging information
|
8 |
+
print("Current working directory:", os.getcwd())
|
9 |
+
print("Contents of current directory:", os.listdir())
|
10 |
|
11 |
+
# Try multiple possible locations for the CSV file
|
12 |
+
possible_locations = [
|
13 |
+
'INSTITUTIONAL_INVESTORS_SCORE.csv',
|
14 |
+
'/home/user/app/INSTITUTIONAL_INVESTORS_SCORE.csv',
|
15 |
+
'/content/INSTITUTIONAL_INVESTORS_SCORE.csv',
|
16 |
+
os.path.join(os.getcwd(), 'INSTITUTIONAL_INVESTORS_SCORE.csv')
|
17 |
+
]
|
18 |
|
19 |
+
df = None
|
20 |
+
for location in possible_locations:
|
21 |
+
try:
|
22 |
+
print(f"Trying to read from: {location}")
|
23 |
+
df = pd.read_csv(location)
|
24 |
+
print(f"Successfully read from: {location}")
|
25 |
+
break
|
26 |
+
except FileNotFoundError:
|
27 |
+
print(f"File not found at: {location}")
|
28 |
+
|
29 |
+
if df is None:
|
30 |
+
raise FileNotFoundError("Could not find the CSV file in any of the expected locations.")
|
31 |
|
32 |
# Clean the data
|
33 |
df = df.dropna(subset=['final_score'])
|