mohamed-chs / chatgpt-history-export-to-md

A script to effortlessly extract your entire ChatGPT data export from JSON files to nicely-formatted markdown files.
MIT License
707 stars 35 forks source link

ValueError in data_analysis.py on the call of .generate() of WordCloud #34

Open yasirfaizahmed opened 9 months ago

yasirfaizahmed commented 9 months ago

About Wanted to convert .zip to a .md files

To Reproduce All default inputs are given by pressing just "Return" for all asked inputs like shown below

? Enter the path to the zip file : /home/xd/Downloads/b455353cfb9d91342741e3be5caf32bac5bfdc3200a5c2ed274d8b606825027 6-2024-02-17-18-37-08.zip ? Enter the path to the output folder : /home/xd/Documents/ChatGPT Data ? Enter the message header (#) for messages from 'system' : ### System ? Enter the message header (#) for messages from 'user' : # Me ? Enter the message header (#) for messages from 'assistant' : # ChatGPT ? Enter the message header (#) for messages from 'tool' : ### Tool output ? Select the LaTeX math delimiters you want to use : default ? Select the YAML metadata headers you want to include : done (9 selections) ? Select the font you want to use for the word clouds : RobotoSlab-Thin ? Select the color theme you want to use for the word clouds : prism ? Enter custom stopwords (separated by commas) : use, file

Expected behavior

Done โœ… ! Check the output ๐Ÿ“ˆ here : file:///home/xd/Documents/ChatGPT%20Data/Graphs ๐Ÿ”—

(more graphs ๐Ÿ“ˆ will be added in the future ...)

Creating weekly wordclouds ๐Ÿ”กโ˜๏ธ :   0%|                                                       | 0/41 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/__main__.py", line 5, in <module>
    main()
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/cli.py", line 76, in main
    generate_wordclouds(
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/long_runs.py", line 70, in generate_wordclouds
    week_groups[week].wordcloud(**kwargs).save(
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/models/_conversation_set.py", line 150, in wordcloud
    return generate_wordcloud(text, **kwargs)
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/data_analysis.py", line 117, in generate_wordcloud
    ).generate(text)
  File "/home/xd/.local/lib/python3.10/site-packages/wordcloud/wordcloud.py", line 642, in generate
    return self.generate_from_text(text)
  File "/home/xd/.local/lib/python3.10/site-packages/wordcloud/wordcloud.py", line 624, in generate_from_text
    self.generate_from_frequencies(words)
  File "/home/xd/.local/lib/python3.10/site-packages/wordcloud/wordcloud.py", line 453, in generate_from_frequencies
    self.generate_from_frequencies(dict(frequencies[:2]),
  File "/home/xd/.local/lib/python3.10/site-packages/wordcloud/wordcloud.py", line 511, in generate_from_frequencies
    box_size = draw.textbbox((0, 0), word, font=transposed_font, anchor="lt")
  File "/usr/lib/python3/dist-packages/PIL/ImageDraw.py", line 671, in textbbox
    raise ValueError("Only supported for TrueType fonts")
ValueError: Only supported for TrueType fonts

Screenshots Screenshot from 2024-02-18 00-28-40

OS