# StarCoderBase results in HuggingChat vs API

**URL:** <https://discuss.huggingface.co/t/starcoderbase-results-in-huggingchat-vs-api/39046>\
**Category:** 🤗Hub\
**Created:** [May 8, 2023, 4:53am UTC](https://discuss.huggingface.co/t/starcoderbase-results-in-huggingchat-vs-api/39046 "2023-05-08T04:53:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wojciech](https://avatars.discourse-cdn.com/v4/letter/w/f08c70/32.png) [@Wojciech](https://discuss.huggingface.co/u/Wojciech)\
**Post date:** [May 8, 2023, 4:53am UTC](https://discuss.huggingface.co/t/starcoderbase-results-in-huggingchat-vs-api/39046/1 "2023-05-08T04:53:02Z")

</div>

Hello,

I’m trying to generate Python code using the StarCoderBase model. I get decent results via HuggingChat and the results there are pretty decent.

Here’s my code:

```python
from huggingface_hub.inference_api import InferenceApi

import os
from dotenv import load_dotenv

load_dotenv()
hfkey = os.getenv("HUGGING_FACE_API_KEY")

inference = InferenceApi(repo_id="bigcode/starcoderbase", token=hfkey)

x = inference(inputs="I have a pandas dataframe, df, with 'latitude' and 'longitude' columns. Please provide an algorithm to cluster these points.")
print(x)

```

Here’s my result:

```auto
[{'generated_text': "I have a pandas dataframe, df, with 'latitude' and 'longitude' columns. Please provide an algorithm to cluster these points.\n\n# +\n# Your code here\n# -\n\n# ## 2.2"}]

```

When I submit the same request (i.e., “I have a pandas dataframe, df, with ‘latitude’ and ‘longitude’ columns. Please provide an algorithm to cluster these points.”) to HuggingChat, I get a much better response: [HuggingChat](https://hf.co/chat/r/NeF9uzH)

Could someone let me know what I’m doing wrong? I thought the results would be similar via these two approaches.

Thanks,  
Wojciech
