🚩 Report: Fix this issue

#1
by stackShamim - opened

always give 'hungry' as output

stackShamim changed discussion title from 🚩 Report: Spam to 🚩 Report: Fix this issue

Yeah, because the dataset is imbalanced, and I am trying now to solve the problem

always give 'hungry' as output

I got the same output result

you have to pre-process the input before you pass it to the model or the API, You can use this code :

model_id = "ntu-spml/distilhubert"
feature_extractor = AutoFeatureExtractor.from_pretrained( model_id)

def preprocess_function(examples):
max_duration = 10.0
audio_arrays = [x["array"] for x in examples["audio"]]
inputs = feature_extractor(
audio_arrays,
sampling_rate=feature_extractor.sampling_rate,
max_length=int(feature_extractor.sampling_rate * max_duration),
truncation=True,
return_attention_mask=True,
)
return inputs

Sign up or log in to comment