cmagganas's picture
Upload folder using huggingface_hub
9de5882
raw
history blame contribute delete
No virus
814 Bytes
from openai_chat_completion import OpenAIChatCompletions
# read in llm-data-cleaner/prompts/gpt4-system-message.txt file into variable system_message
system_message = open('../prompts/gpt4-system-message.txt', 'r').read()
# create an instance of the OpenAIChatCompletions class and use the openai_chat_completion method to get chat completions
chat_completions = OpenAIChatCompletions(model="gpt-4", system_message=system_message)
# prompt = "co-2MFE5QVF,Chill Medicated - Watermelon - Syrup - 250mg,Chill Medicated,nan,nan,nan"
# completion = chat_completions.openai_chat_completion(prompt, n_shot=1)
# print(completion)
prompts, completions, predictions = chat_completions.predict_jsonl(n_samples=2, n_shot=2)
print("Prompts:", prompts)
print("Completions:", completions)
print("Predictions:", predictions)