# How to add parameter in inference endpoint?

**URL:** <https://discuss.huggingface.co/t/how-to-add-parameter-in-inference-endpoint/44034>\
**Category:** Inference Endpoints on the Hub\
**Created:** [June 21, 2023, 12:10pm UTC](https://discuss.huggingface.co/t/how-to-add-parameter-in-inference-endpoint/44034 "2023-06-21T12:10:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foson](https://avatars.discourse-cdn.com/v4/letter/f/34f0e0/32.png) [@Foson](https://discuss.huggingface.co/u/Foson)\
**Post date:** [June 21, 2023, 12:10pm UTC](https://discuss.huggingface.co/t/how-to-add-parameter-in-inference-endpoint/44034/1 "2023-06-21T12:10:32Z")

</div>

How to add parameter in inference endpoint(not inference API)?  
Here is my code:

```auto
        self.API_URL = url
        self.headers = {"Authorization": f"Bearer {open('config/hugging_face.txt').read()}", 'Content-Type': 'application/json'}
        
    def get_answers(self, input, n):
        data = json.dumps({"inputs": input, "parameters": {"return_full_text": False, "num_return_sequences": n, "do_sample": True}})
        response = requests.request("POST", self.API_URL, headers=self.headers, data=data)
        return [output['generated_text'] for output in json.loads(response.content.decode("utf-8"))]

```

Anyway, it keeps returning a sequence, instead of 5(n = 5).  
Help appreciated!

---

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](https://discuss.huggingface.co/u/philschmid)\
**Post date:** [June 21, 2023, 1:37pm UTC](https://discuss.huggingface.co/t/how-to-add-parameter-in-inference-endpoint/44034/2 "2023-06-21T13:37:31Z")

</div>

> [@Foson](#):
>
> `num_return_sequences`

is only supported with beam search.

---

<div class="post-metadata">

**Author:** ![Foson](https://avatars.discourse-cdn.com/v4/letter/f/34f0e0/32.png) [@Foson](https://discuss.huggingface.co/u/Foson)\
**Post date:** [June 22, 2023, 2:11am UTC](https://discuss.huggingface.co/t/how-to-add-parameter-in-inference-endpoint/44034/3 "2023-06-22T02:11:04Z")

</div>

How can I turn beam search on in inference endpoint? looks as if I don’t need to turn it on in inference API.
