Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -65,35 +65,23 @@ st.markdown("""
|
|
65 |
|
66 |
@st.cache_resource
|
67 |
def load_movie_data():
|
68 |
-
# Option 1: Try loading with trust_remote_code
|
69 |
try:
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
trust_remote_code=True # Explicitly allow trusted code
|
74 |
-
)
|
75 |
-
print(dataset.column_names)
|
76 |
df = pd.DataFrame(dataset)
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
80 |
return df
|
81 |
-
|
82 |
except Exception as e:
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
return pd.DataFrame([
|
87 |
-
{
|
88 |
-
"context": "Title: The Dark Knight\nPlot: Batman faces the Joker...\nYear: 2008\nCast: Christian Bale, Heath Ledger\nDirector: Christopher Nolan"
|
89 |
-
},
|
90 |
-
{
|
91 |
-
"context": "Title: Inception\nPlot: A thief who enters dreams...\nYear: 2010\nCast: Leonardo DiCaprio\nDirector: Christopher Nolan"
|
92 |
-
},
|
93 |
-
{
|
94 |
-
"context": "Title: Pulp Fiction\nPlot: Interconnected stories of criminals...\nYear: 1994\nCast: John Travolta\nDirector: Quentin Tarantino"
|
95 |
-
}
|
96 |
-
])
|
97 |
|
98 |
|
99 |
@st.cache_resource
|
|
|
65 |
|
66 |
@st.cache_resource
|
67 |
def load_movie_data():
|
|
|
68 |
try:
|
69 |
+
st.write("π Attempting to load dataset...")
|
70 |
+
|
71 |
+
dataset = load_dataset("eraser-benchmark/movie_rationales", split="train[:5]", trust_remote_code=True)
|
|
|
|
|
|
|
72 |
df = pd.DataFrame(dataset)
|
73 |
+
|
74 |
+
st.write("β
Columns in dataset:")
|
75 |
+
st.write(df.columns.tolist())
|
76 |
+
st.write("π Sample row:")
|
77 |
+
st.write(df.iloc[0])
|
78 |
+
|
79 |
return df
|
80 |
+
|
81 |
except Exception as e:
|
82 |
+
st.error(f"β Dataset loading failed: {str(e)}")
|
83 |
+
return pd.DataFrame()
|
84 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
|
87 |
@st.cache_resource
|