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:
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:
[{'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
Could someone let me know what Iām doing wrong? I thought the results would be similar via these two approaches.
Thanks,
Wojciech