Spaces:
Sleeping
Sleeping
Upload Gradio app, model, and environment file with logging
Browse files- .environment +1 -0
- app.py +6 -0
.environment
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
python_version 3.12
|
app.py
CHANGED
|
@@ -4,9 +4,13 @@ from autogluon.tabular import TabularPredictor
|
|
| 4 |
import pandas as pd
|
| 5 |
import os
|
| 6 |
|
|
|
|
|
|
|
| 7 |
# Load the model from the `model/` folder in this repo
|
| 8 |
predictor_path = os.path.join(os.path.dirname(__file__), "model")
|
|
|
|
| 9 |
predictor = TabularPredictor.load(predictor_path, require_py_version_match=False)
|
|
|
|
| 10 |
|
| 11 |
key_center_mapping = {
|
| 12 |
0: "A", 1: "Bb", 2: "B", 3: "C", 4: "Db", 5: "D",
|
|
@@ -75,6 +79,7 @@ examples = [
|
|
| 75 |
[174, 129, 31, 2, 1],
|
| 76 |
]
|
| 77 |
|
|
|
|
| 78 |
with gr.Blocks() as demo:
|
| 79 |
gr.Markdown("# Classical Music Composer Classifier")
|
| 80 |
gr.Markdown("Predict whether a piece was composed by **Mozart** or **Beethoven**.")
|
|
@@ -99,3 +104,4 @@ with gr.Blocks() as demo:
|
|
| 99 |
- **Musical Marking**: Tempo/style indication (Minuet=0, Allegro=1, Andante=2, Moderato=3, Allegretto=4, Dance=5)
|
| 100 |
''')
|
| 101 |
|
|
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
import os
|
| 6 |
|
| 7 |
+
print("Starting app.py script")
|
| 8 |
+
|
| 9 |
# Load the model from the `model/` folder in this repo
|
| 10 |
predictor_path = os.path.join(os.path.dirname(__file__), "model")
|
| 11 |
+
print(f"Loading predictor from: {predictor_path}")
|
| 12 |
predictor = TabularPredictor.load(predictor_path, require_py_version_match=False)
|
| 13 |
+
print("Predictor loaded successfully")
|
| 14 |
|
| 15 |
key_center_mapping = {
|
| 16 |
0: "A", 1: "Bb", 2: "B", 3: "C", 4: "Db", 5: "D",
|
|
|
|
| 79 |
[174, 129, 31, 2, 1],
|
| 80 |
]
|
| 81 |
|
| 82 |
+
print("Creating Gradio Blocks")
|
| 83 |
with gr.Blocks() as demo:
|
| 84 |
gr.Markdown("# Classical Music Composer Classifier")
|
| 85 |
gr.Markdown("Predict whether a piece was composed by **Mozart** or **Beethoven**.")
|
|
|
|
| 104 |
- **Musical Marking**: Tempo/style indication (Minuet=0, Allegro=1, Andante=2, Moderato=3, Allegretto=4, Dance=5)
|
| 105 |
''')
|
| 106 |
|
| 107 |
+
print("Gradio Blocks created")
|