Pipeline cannot infer suitable model classes
When I try to use the inference pipeline widget for my private project, I got this error.Screenshot_20211103-195337_Chrome1093×1404 142 KBBut the prediction is working when I do locally (gives back proper labels)
2021-11-05T09:51:41Z
Pinging@Narsil
2021-11-05T12:29:52Z
Seems to be working now, did you fix anything particular ?Edit: Looked at the wrong repo I guess.
2021-11-05T15:59:25Z
Hi. Yes, it is working now. Thanks for that. But now, it is only displaying 5 of the classification labels (for context, there are 14 labels). The labels are not shown as top 5 predictions, but the first 5 labels defined in config.json. Is there a way in the pipeline to define a number of classification labels as percentages from highest to lowest?ReferenceCan we manually override top_k value from README.md?
2021-11-11T09:39:52Z
Hi@Rajaram1996The predictions should always show the 5 top scores, can you provide a link to the wrong behavior ?Cheers,
2021-11-11T16:18:03Z
When I use the hosted inference widget, I am only getting the confidence score of 5 random emotions which are not the top_5 values. I am adding image for reference.Screen Shot 2021-11-11 at 11.08.35 AM879×789 43.4 KBWhen I predict with the model on my local inference, I get “female_happy 0.98” or 98% (image attached below) which is supposed to be the correct prediction (in total there are 14 classes to predict from).sample prediction1634×164 18.2 KB
2021-11-12T11:24:49Z
The API is powered by the pipelines, it seems you’re trying a private model so I don’t really have access, but you can check outpipe = pipeline(model="NR/myprivate_model")pipe("myfilename.wav")It should work out of the box and produce the same thing as the API.
2021-11-12T15:18:12Z
Hey. Thanks for working through this. You can check the modelhere. Even that pipeline snippet, which I tried in my colab notebook gave me this:[{'label': 'male_disgust', 'score': 0.07790017127990723},  {'label': 'female_sad', 'score': 0.07736612856388092},  {'label': 'female_neutral', 'score': 0.07557496428489685},  {'label': 'female_angry', 'score': 0.07553239166736603},  {'label': 'female_disgust', 'score': 0.07268150895833969}]Let me know if you need more info.
2021-11-13T15:18:11Z
@Narsilthe model I want to use is public but doesn’t have an appropriate pipeline.What are my options for using it in inferencing?Figured it out.
2021-11-15T10:39:02Z
@Rajaram1996,I just checked your model, and it seems it’s using'classifier.dense.bias', 'classifier.out_proj.weight', 'classifier.out_proj.bias', 'classifier.dense.weight'instead of'classifier.bias', 'classifier.weight', 'projector.weight', 'projector.bias'when loading (check the warings), which leads to random outputs no matter the input.Try renaming the tensors appropriately for it to work.So most likely, the pipeline is not broken but it just seems like the weights are incorrect so the head gives garbage output.
2021-11-15T14:54:44Z
Thank you for that information. I will check it out.
2023-05-29T10:30:30Z
I’m facing the same problem. Could someone help please.huggingface.coKELONMYOSA/wav2vec2-xls-r-300m-emotion-ru · Hugging FaceWe’re on a journey to advance and democratize artificial intelligence through open source and open science.But the pipeline works locally