Spaces:
Runtime error
Runtime error
Increased Data Size
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import numpy as np
|
|
| 9 |
def load_data():
|
| 10 |
try:
|
| 11 |
# For Hugging Face Spaces deployment, you might need to adjust this path
|
| 12 |
-
data = pd.read_csv('games_march2025_cleaned.csv', nrows=
|
| 13 |
return data
|
| 14 |
except Exception as e:
|
| 15 |
print(f"Error loading data: {e}")
|
|
@@ -134,11 +134,11 @@ def recommend_games(game_name, max_age, max_price, min_metacritic):
|
|
| 134 |
|
| 135 |
# Create the Gradio interface
|
| 136 |
with gr.Blocks(title="Steam Game Recommender") as demo:
|
| 137 |
-
gr.Markdown("#
|
| 138 |
gr.Markdown("Enter a game you like and customize filters to get similar suggestions.")
|
| 139 |
|
| 140 |
with gr.Row():
|
| 141 |
-
input_text = gr.Textbox(label="
|
| 142 |
|
| 143 |
with gr.Row():
|
| 144 |
max_age_slider = gr.Slider(0, 21, value=17, label="Max Age Rating (Avoid Adult Games)")
|
|
@@ -146,10 +146,10 @@ with gr.Blocks(title="Steam Game Recommender") as demo:
|
|
| 146 |
min_metacritic_slider = gr.Slider(0, 100, value=50, step=1, label="Minimum Metacritic Score")
|
| 147 |
|
| 148 |
with gr.Row():
|
| 149 |
-
submit_btn = gr.Button("
|
| 150 |
|
| 151 |
with gr.Row():
|
| 152 |
-
output_text = gr.Markdown(label="
|
| 153 |
|
| 154 |
submit_btn.click(
|
| 155 |
fn=recommend_games,
|
|
|
|
| 9 |
def load_data():
|
| 10 |
try:
|
| 11 |
# For Hugging Face Spaces deployment, you might need to adjust this path
|
| 12 |
+
data = pd.read_csv('games_march2025_cleaned.csv', nrows=88899, on_bad_lines='skip', engine='python')
|
| 13 |
return data
|
| 14 |
except Exception as e:
|
| 15 |
print(f"Error loading data: {e}")
|
|
|
|
| 134 |
|
| 135 |
# Create the Gradio interface
|
| 136 |
with gr.Blocks(title="Steam Game Recommender") as demo:
|
| 137 |
+
gr.Markdown("#Steam Game Recommender")
|
| 138 |
gr.Markdown("Enter a game you like and customize filters to get similar suggestions.")
|
| 139 |
|
| 140 |
with gr.Row():
|
| 141 |
+
input_text = gr.Textbox(label="Favorite Game")
|
| 142 |
|
| 143 |
with gr.Row():
|
| 144 |
max_age_slider = gr.Slider(0, 21, value=17, label="Max Age Rating (Avoid Adult Games)")
|
|
|
|
| 146 |
min_metacritic_slider = gr.Slider(0, 100, value=50, step=1, label="Minimum Metacritic Score")
|
| 147 |
|
| 148 |
with gr.Row():
|
| 149 |
+
submit_btn = gr.Button("Get Recommendations")
|
| 150 |
|
| 151 |
with gr.Row():
|
| 152 |
+
output_text = gr.Markdown(label="Recommendations")
|
| 153 |
|
| 154 |
submit_btn.click(
|
| 155 |
fn=recommend_games,
|