mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-28 17:29:30 +00:00
feat: add logging to humor dataset generation script
This commit is contained in:
parent
51fc48fd05
commit
03902ccd45
1 changed files with 6 additions and 0 deletions
|
|
@ -2,6 +2,10 @@ import os
|
||||||
import json
|
import json
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from openai import OpenAI
|
from openai import OpenAI
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
@ -23,6 +27,7 @@ def main():
|
||||||
|
|
||||||
output_file = "humor_dataset.jsonl"
|
output_file = "humor_dataset.jsonl"
|
||||||
model_name = "gpt-4o-mini"
|
model_name = "gpt-4o-mini"
|
||||||
|
logger.info(f"Generating humor dataset to {output_file} using model {model_name}")
|
||||||
|
|
||||||
with open(output_file, "w", encoding="utf-8") as fout:
|
with open(output_file, "w", encoding="utf-8") as fout:
|
||||||
for comedian in comedians:
|
for comedian in comedians:
|
||||||
|
|
@ -43,6 +48,7 @@ def main():
|
||||||
"response": answer,
|
"response": answer,
|
||||||
}
|
}
|
||||||
fout.write(json.dumps(record, ensure_ascii=False) + "\n")
|
fout.write(json.dumps(record, ensure_ascii=False) + "\n")
|
||||||
|
logger.info(f"Wrote record: comedian={comedian}, format={fmt}")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue