# How do I get logits from an Inference API Wav2Vec2 model?

**URL:** <https://discuss.huggingface.co/t/how-do-i-get-logits-from-an-inference-api-wav2vec2-model/97449>\
**Category:** Inference Endpoints on the Hub\
**Created:** [July 15, 2024, 4:43pm UTC](https://discuss.huggingface.co/t/how-do-i-get-logits-from-an-inference-api-wav2vec2-model/97449 "2024-07-15T16:43:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ct-vikramanantha](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ct-vikramanantha/32/29389_2.png) [@ct-vikramanantha](https://discuss.huggingface.co/u/ct-vikramanantha)\
**Post date:** [July 15, 2024, 4:43pm UTC](https://discuss.huggingface.co/t/how-do-i-get-logits-from-an-inference-api-wav2vec2-model/97449/1 "2024-07-15T16:43:41Z")

</div>

I’m trying to use a finetuned Wav2Vec2 model that I uploaded to hugging face through Inference API / Inference Endpoints, but it seems to be using Pipeline to call the model, meaning it will only return the final prediction of the model, not the logits from the model. Is there any way to make Inference API return the logits and not the final prediction?

I saw in a previous post that you can add

```auto
inference:
   parameters:
     function_to_apply: none

```

to the README.md to make it not apply a function to the logits to return the prediction, but that didn’t do anything

---

<div class="post-metadata">

**Author:** ![GBaker](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@GBaker](https://discuss.huggingface.co/u/GBaker)\
**Post date:** [August 6, 2024, 7:57pm UTC](https://discuss.huggingface.co/t/how-do-i-get-logits-from-an-inference-api-wav2vec2-model/97449/2 "2024-08-06T19:57:47Z")

</div>

I was able to change `function_to_apply` to `none` for my ImageClassification endpoint calls by passing it in as a parameter:

```auto
parameters = {
    "function_to_apply": "none",
    "top_k": None
}

response = requests.post(API_URL, headers=headers, params=parameters, data=img_byte_arr)

```
