aweber commited on
Commit
8002c04
·
verified ·
1 Parent(s): 01aed3d

Update tasks/audio.py

Browse files
Files changed (1) hide show
  1. tasks/audio.py +5 -5
tasks/audio.py CHANGED
@@ -20,8 +20,8 @@ router = APIRouter()
20
 
21
  DESCRIPTION = "Random Forest"
22
  ROUTE = "/audio"
23
- # MODEL_PATH = Path(__file__).parent / "audio_models" / "RandomForestClassifier_withScaler.pkl"
24
- MODEL_PATH = Path(__file__).parent / "audio_models" / "RandomForestClassifier_withScaler_cloudpickle.pkl"
25
 
26
 
27
  @router.post(ROUTE, tags=["Audio Task"], description=DESCRIPTION)
@@ -63,10 +63,10 @@ async def evaluate_audio(request: AudioEvaluationRequest):
63
  # Extract audio samples from test_dataset
64
  x_test = [sample["audio"]["array"] for sample in test_dataset]
65
 
66
- # clf = joblib.load(MODEL_PATH)
67
 
68
- with open(MODEL_PATH, 'rb') as f:
69
- clf = pickle.load(f)
70
 
71
  predictions = clf.predict(x_test)
72
 
 
20
 
21
  DESCRIPTION = "Random Forest"
22
  ROUTE = "/audio"
23
+ MODEL_PATH = Path(__file__).parent / "audio_models" / "RandomForestClassifier_withScaler.pkl"
24
+ # MODEL_PATH = Path(__file__).parent / "audio_models" / "RandomForestClassifier_withScaler_cloudpickle.pkl"
25
 
26
 
27
  @router.post(ROUTE, tags=["Audio Task"], description=DESCRIPTION)
 
63
  # Extract audio samples from test_dataset
64
  x_test = [sample["audio"]["array"] for sample in test_dataset]
65
 
66
+ clf = joblib.load(MODEL_PATH)
67
 
68
+ # with open(MODEL_PATH, 'rb') as f:
69
+ # clf = pickle.load(f)
70
 
71
  predictions = clf.predict(x_test)
72