# Strange answer from api

**URL:** <https://discuss.huggingface.co/t/strange-answer-from-api/13538>\
**Category:** 🤗Transformers\
**Created:** [January 10, 2022, 10:33am UTC](https://discuss.huggingface.co/t/strange-answer-from-api/13538 "2022-01-10T10:33:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![avorozhko](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@avorozhko](https://discuss.huggingface.co/u/avorozhko)\
**Post date:** [January 10, 2022, 10:33am UTC](https://discuss.huggingface.co/t/strange-answer-from-api/13538/1 "2022-01-10T10:33:28Z")

</div>

Hello! I have own fine tuned the model (russian language) for generate text.  
When I use:

```auto
API_URL = "https://api-inference.huggingface.co/models/avorozhko/ruDialoGpt3-medium-finetuned-context"
headers = {"Authorization": "Bearer ****"}

def query(payload):
    data = json.dumps(payload, ensure_ascii=False).encode('utf8')
    print(data)
    print(data.decode("utf-8"))
    response = requests.request("POST", API_URL, headers=headers, data=data)
    return json.loads(response.content.decode("utf-8"))

payload = {
       "inputs": "|0|1|Привет, как твои дела?</s>",
       "parameters": {
          "num_return_sequences": 1,
          "min_length": 2,
          "max_length": 500,
          "no_repeat_ngram_size": 3,
          "do_sample": True,
          "top_k": 50,
          "top_p": 0.9,
          "temperature": 0.6,
          "mask_token_id": 4,
          "eos_token_id": 2,
          "unk_token_id": 3,
          "pad_token_id": 0
     },
    }

output = query(payload)

```

The answer is:

```auto
[{'generated_text': '|0|1|Привет, как твои дела?</s> character persider Persider pers person characters прищурилсятизмом туловища физиономии pattern settledтизматизмтизinessительностьжесто natureливости�||1'}]

```

But must be like this:

```auto
[{'generated_text': '|0|1|Привет, как твои дела?</s>|1|1|А ты кто?</s>}]

```

In the Google Colaboratory works fine, here is the example:

> **[Google Colaboratory](https://colab.research.google.com/drive/1QisPIKP5uNgkCVmXpGcqVdJhqwqHC-5a?usp=sharing)**
