leonid20000 / odin-slides

This is an advanced Python tool that empowers you to effortlessly draft customizable PowerPoint slides using the Generative Pre-trained Transformer (GPT) of your choice. Leveraging the capabilities of Large Language Models (LLM), odin-slides enables you to turn the lengthiest Word documents into well organized presentations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error running in Ubuntu 22 and CentOS system

bolecodex opened this issue · comments

Hi,

Thanks for the wonderful tool! May I ask if you tried the tool in Linux system? It is because when I tried both in Ubuntu and CentOS, it points out the following messages in the debug_log.txt:

2023-12-08 23:47:50,562 - DEBUG - 30
2023-12-08 23:47:50,566 - ERROR - An unexpected error occurred while loading the presentation: Package not found at 'demo.pptx'
2023-12-08 23:47:56,324 - ERROR - An unexpected error occurred: 'usage'
2023-12-08 23:47:56,328 - DEBUG - None
2023-12-08 23:47:56,329 - DEBUG - Not neccessarily an error but Invalid JSON string
2023-12-08 23:47:56,329 - DEBUG - the JSON object must be str, bytes or bytearray, not NoneType

The prompt will return "Hmm, not sure what you want so I did not make any changes. Try differently: >" and no output PPT can be generated.

May I ask if you have any idea about this issue?

Best regards,
Weibo

commented

@bolecodex Hello Weibo, I have tested it before on Ubuntu 20.04. Thank you for the reported issue, let me look into it. Meanwhile would you be kind to provide the command which you ran and also the prompt?

Cheers,

Hi Leonit, thanks for your response. The command I execute is the following:

odin-slides -t template.pptx -i input.docx -o demo

commented

@bolecodex thank you Weibo, On my side I am able to use the tool on Linux without issues:
Weibo1

Take note of the followings to troubleshoot the issue that you are facing:
1- Check your odin-slides version:
Weibo3

2- You didn't mention what your initial prompt was, but my suggestion is to retry with shorter prompts at first, like the one I used, and then gradually ask it to make changes. That particular response that you shared from the log "Hmm, not sure what you want so I did not make any changes. Try differently: >" indicates that OpenAI responded in a way which was not useful for odin-slides, when this happens you just retry. To make it happen less, keep the prompts short and concise especially the initial prompt.

3- I attached the result of the test on my side:
Weibo2
the pptx file that you provide as template can be any desired pptx file. From the available layouts in that file, only the layout called Title and Content (or the one whose name is the most similar to this) will be used.

Try these and let me know if it helped to troubleshoot the issue that you are facing.

commented

Another very important thing to check is your ODIN_SLIDES_LLM_API_KEY environment variable. I suspect, you might have rotated the key but forgot to update the environment variable.
Try resetting the environment variable to a valid key.

Make sure that the environment variable is correct by doing a helloworld api call, something like:


curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ODIN_SLIDES_LLM_API_KEY" \
  -d '{
  "model": "gpt-3.5-turbo",
  "messages": [
    {
      "role": "system",
      "content": "Summarize content for user."
    },
    {
      "role": "user",
      "content": "Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter.[19] When viewed from Earth, Jupiter can be bright enough for its reflected light to cast visible shadows,[20] and is on average the third-brightest natural object in the night sky after the Moon and Venus."
    }
  ],
  "temperature": 0.7,
  "max_tokens": 64,
  "top_p": 1
}'

Hi Leonit,

thanks for your so detailed instructions! I have solved the problem now. It was because my PPT template file and also my previous openAI API key is not valid.

Best regards,
Weibo