korymath / talk-generator

talk-generator is capable of generating coherent slide decks based on a single topic suggestion.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

type error when no images are returned

korymath opened this issue · comments

commented

Should handle this no response nicely...

run code: python3 run.py --topic 'edmonton' --num_slides 5 --num_images 1

(venv)  ✘  ~/work/talk-generator   master  python3 run.py --topic 'edmonton' --num_slides 5 --num_images 1
******************************************
Making 5 slide talk on: edmonton
Pickle saved to output/edmonton.pkl
******************************************
Generating slide 1 about edmonton using SlideGenerator[Title slide]
Generating slide 2 about edmonton using SlideGenerator[Giphy]
Generating slide 3 about edmonton using SlideGenerator[Google Images]
Traceback (most recent call last):
  File "run.py", line 436, in <module>
    main(args)
  File "run.py", line 345, in main
    presentation = schema.generate_presentation(arguments.topic, arguments.num_slides)
  File "/Users/korymathewson/work/talk-generator/presentation_schema.py", line 59, in generate_presentation
    self._generate_slide(presentation, seed_generator, slide_nr, num_slides, set())
  File "/Users/korymathewson/work/talk-generator/presentation_schema.py", line 72, in _generate_slide
    slide = generator.generate(presentation, seed)
  File "/Users/korymathewson/work/talk-generator/presentation_schema.py", line 21, in generate
    slide = self._generator(presentation, seed)
  File "/Users/korymathewson/work/talk-generator/slide_templates.py", line 128, in <lambda>
    return lambda prs, seed: create_full_image_slide(prs, title_generator(seed), image_generator(seed))
  File "run.py", line 272, in get_related_google_image
    img_paths = get_google_images(seed_word, 1)
  File "run.py", line 166, in get_google_images
    if len(paths) == 0:
TypeError: object of type 'NoneType' has no len()

I can't seem to reproduce this error.
It also seems to refer to a line of code that was already changed in this commit: f36bc0dfc06fc9d7c6ce2f0f2a5f2a13ca25d17b.
Was this using an older version than that commit?

commented

Yes, indeed it was. Apologies.