iryna-kondr / scikit-llm

Seamlessly integrate LLMs into scikit-learn.
https://beastbyte.ai/
MIT License
3.38k stars 275 forks source link

Added functionality for custom prompts #70

Closed KennethEnevoldsen closed 1 year ago

KennethEnevoldsen commented 1 year ago

Added functionality for creating overwriting the existing prompt with a custom prompt.

(wanted to test this using the pytests, but it seems like they are broken due to a missing function) I fixed the tests as well

intended use-case:

my_template = """
List of categories: {labels}

Text sample: ```{x}```

Your JSON response:
"""

# create clf
clf = ZeroShotGPTClassifier(openai_key = "<key>",
        openai_org="<ORG>"
        openai_model = "gpt-3.5-turbo",
        default_label = "Random", 
        prompt_template= my_template)