#Presentator - power point & images generator

236 messages · Page 1 of 1 (latest)

woeful sandal
#

Yes, you read right! This discord bot allows you to create beatiful power point presentations from a given prompt, and with an NVIDIA GPU also automatically generates and adds images!
How it works
- The bot sends a request to the openai api with the given subject and indications in the marp markdown format
- We extract the images from the markdown and send them to the image generation api
- We generate the pdf and html files from the markdown
- We send the pdf and html files to the user
More informations on the github page. leave a dallestar if you like it!
https://github.com/Paillat-dev/presentator

GitHub

A Discord bot that generates FULL powerpoints about a given subject thanks to openai's gpt3 - GitHub - Paillat-dev/presentator: A Discord bot that generates FULL powerpoints about a given s...

ornate swallow
#

pos

woeful sandal
heavy nacelle
#

how do i install it

#

or use it

#

@woeful sandalhow do i use chatgpt to make power point presentations?

woeful sandal
heavy nacelle
#

ok

vast hawk
#

what is the spec requirement to run it ?

woeful sandal
# vast hawk what is the spec requirement to run it ?

none, if you don't generate images, if you do, you will have 2 options: 1 use dalle 2 (no requirements), 2 use stable diffusion (work better with a good gpu). In a couple of days i will add dalle support, just need to do a couple adjustements).

jade flint
#

Can i use it on mobile ?

woeful sandal
steel vector
#

Interesting. How does the image fetching work? Does it scrape a site like unsplash?

woeful sandal
glossy bay
#

Hey @woeful sandal, can you please guide me how you guys are building apps like these? I also have some cool ideas but don't know from where to start. I'm a good web developer but when it comes to AI I get confused. Here are my few questions

  1. Do we need some kind of dataset to first train the model? Or is there any better approach?
  2. Any blog/video from where I can get the guidance?
woeful sandal
#

No, openai already trained the models. A good point to start, is totry some things in the playground: https://beta.openai.com/playground .
Here you can type some prompts, and the AI will answer. But it's "only" a text completition AI. SO you cannot chat like chatgpt, but complete text. You need to give context, andd to "force" the AI to give you what you want.
For example, the prompt:

Here is a reciepe for a cake:

Will return you a reicepe for a cake.
But

How can i make a cake

Will sometimes something like:

 without eggs?
[...]

Because the ai completed your question.

For my powerpoint generating ai, the prompt is the following:

Here is a presentation with marp. It's not possible to make slides longer than 200 characters. to separate slides, 
"
---
"
 then go at the line. The presentatio should be for everybody, all technical words and concepts, explained. To add an image illustration , use ![bg left:50% 70%](a-description-of-the-image.png) at the beginning of the slide, just after \"---\". Use only .png. It's not possible to add technical images but only illustrations. The images are generated by an ai, the name of the file should be a detailed description of the image wanted.  For example \" ![bg left:50% 100%](a-man-wearing-a hat-ryding-a-bicicle.png)\" but don't need to show a person necessairly. The presentation is minimum 20 slides long. You can use bulletpoints. Use markdown formatting (titles, etc...). The presentation has also a conclusion. {indications} The subject of the is: {subject} The Language is: {language} <|endofprompt|>

Once you found the prompt you wanted in the playground, you can use the api, to do the exact same thing, but within your code. https://beta.openai.com/docs/api-reference/introduction . Personally i wrote my code in python, but you can also do it in plenty other languages.

#

@glossy bay ⬆️

glossy bay
#

Thanks @woeful sandal. I've few more questions, How can i find the right model and train it on my own data? Let's say I want AI to give result from my own data and gives result from internet if the answer isn't there in my data, how can I do this? Do I first need to create the dataset of my own and then train a pre-trained/new model to achieve this task?

woeful sandal
# glossy bay Thanks <@707196665668436019>. I've few more questions, How can i find the right ...

Training your own model with your data is simple. You can find how to do that here: https://beta.openai.com/docs/api-reference/fine-tunes . You will need to choose a base model to start on, and then have a database of text & expected completition. To choose a base model, you have a comparaision chart here: https://beta.openai.com/docs/models/gpt-3 . The models cannot directly search on the internet. If you want to do that, i think that the best way would be to tell the ai in the prompt to answer [GOOGLE: search simply, and then do the search by yourself, give the information back to the AI, that will process the data to make it human readable. If you haven't a big amount of data, I think you can just give the data directly in the prompt. If you have a lot of data, it can be interesting training a xustom model, and sometimes, in the "expected answers of the AI, just put [GOOGLE: the search that the AI should have done in this case. If you didn't undesrtand my explanations clearly, you can ask me

woeful sandal
#

@glossy bay ⬆️

glossy bay
#

Got it, thanks @woeful sandal

sweet apex
#

where do I type in the install commands?

final notch
#

Hello @woeful sandal, i can only install it on pc and proceed with using the app github? Cause i opened the link and read the requirements and installation, it’s pretty confusing! Should i do all this or only download and use the app?

woeful sandal
woeful sandal
sweet apex
#

it says bot ready, what do I do now?

final notch
# woeful sandal Wich steps are you not understanding?

Almost all these, am not a programer so i don’t know are these steps i should do or these are steps the installation automatically does? And did i get the app usage correctly? You feed in the info you need and the app will transfer them into a presentation right?

woeful sandal
woeful sandal
#

Then, open the terminal, right click and open terminal in teh folder you unzipped

#

Type the commands from the github

sweet apex
woeful sandal
# sweet apex How do I add it to my server?

In the discord dev portal, you go to oauth, then url generato, you check the "BOT" box, then elect administrator, then you copy the link at the bottom and èpaste it in your google chrome

tight mauve
#

following

sweet apex
#

@woeful sandal , Hey the bot is working now, but despite adding the sd key to the image generation, it doesn't input the images within the presentation nor does it generate them separately, any advice on this?

woeful sandal
#

So try selecting dalle in the .env file

sweet apex
#

Sure thing thanks.

sweet apex
#

@woeful sandal I got this error when I tried to get it to give me a presentation with images "No connection could be made because the target machine actively refused it"

woeful sandal
#

And also a screenshot of what your .env looks like, WITHOUT the api keys

sweet apex
#

ok

#

I tried this step

#

Local image generation (optional, only if you use the local image generation option)
Open the file called Dev Console.cmd in the stable-diffusion-ui folder and run the following commands:
uvicorn main:app --reload

#

but it gives me this error about

#

File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File ".\main.py", line 1, in <module>
import sdkit
ModuleNotFoundError: No module named 'sdkit'

sweet apex
#

wdym?

#

how exactly do I do that?

woeful sandal
woeful sandal
#

Then you wait

#

Then you follow the instructions in the link above and switch to beta, remember to save

#

Then you close the "stable diffusion ui" command line window that opened, and reopen Start Stable Diffusion UI.cmd and wait and reclose it

#

And then you can start the API in the Dev-Console

sweet apex
#

whats the command to do that?

#

because I got an error now after making it beta version

#

module 'xformers'. Proceeding without it.

#

I got this error when I tried to turn on developer console and ran the reload command for uvicorn

#

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 413 Payload Too Large (error code: 40005): Request entity too large

#

I used dalle instead but now I get this error

woeful sandal
woeful sandal
woeful sandal
umbral chasm
#

I can install this program on windows 10?

woeful sandal
#

Of course

#

@umbral chasm

sweet apex
#

@woeful sandal so I struggled a little bit and it works for the most part, however I cant get it to upload more than 1 o 2 photos at maximum in the presentation, also the image is always something wayyyy off course to what I described, lastly if it managed to generate more than 2 images, right as it uploads the pdf on discord the terminal gives out an error 40005 about file to large or something. the project is amazing dont get me wrong, its jut if you have a solution to this, it would help soo soo much. thanks.

woeful sandal
# sweet apex <@707196665668436019> so I struggled a little bit and it works for the most par...

That's strange, i never had that error.
To generate more images, you can add in the indications something like "Generate at least 1 image per slide" or "Generate at least 6 images". It won't work always, but most of the time. In the mean time, you can always get the presentation in the /data/YOUR_DISCORD_USER_ID/. Here, you will have different folders, each of them contains a presentation, you can sort them by last modification to see wich one is the new one. In there you should find the complete pdf.
Could you please tell me the number of pages of the pdfs it didn't managed to send?

umbral chasm
#

Hi, how to put my openai api key and discord bot token in the .env.example file and rename it to .env?

woeful sandal
umbral chasm
woeful sandal
#

and add the values

umbral chasm
#

And it's all?

woeful sandal
#

And add obviously the bot to a discord server

umbral chasm
#

How to connect the discord bot to the folder?

woeful sandal
#

you only need to add the token to the file

#

and run the main.py file with python

umbral chasm
#

Ok

umbral chasm
woeful sandal
sweet apex
#

@woeful sandal this does run with python 3.11 as well right?

#

because I want to use only python 3.11 and above from now onwards

#

also do I have to have the code running all the time for this to work? because currently I have to keep the terminal open for anyone on my discord server to make a presentation

woeful sandal
woeful sandal
sweet apex
#

Wdym public version? @woeful sandal

woeful sandal
sweet apex
#

from discord.ext import commands, the discord.ext is underlined and unresolved, when I try to run main.py

#

@woeful sandal

#

any solution to that?

woeful sandal
#

pip uninstall py-cord

#

pip install py-cord

#

Run all the above commands, in the given order

sweet apex
#

ok

#

now when I run it, it says ready, crashes and then gives me this error @commands.cooldown(1, int(cooldown), commands.BucketType.guild)

#

that this line is disfunctional

#

can this run on python 3.10.9 ?

woeful sandal
#

@sweet apex waip

woeful sandal
#

my bad @sweet apex

sweet apex
#

lemme try this rn

#

thanks

woeful sandal
#

i see that you'realready in it

sweet apex
#

yes small problem now

#

its online and connected to my server, it also accepts the command /present. However when I ask it to make a presentation, it decides to crash

#

n error occured: Application Command raised an exception: FileNotFoundError: [Errno 2] No such file or directory: "./data/1072467202634154044/b'cHJvYmxlbXMtYWJvdXQtd3cy'2023-02-07-14-08-58/problems-about-ww2.pdf"

#

.

#

@woeful sandal

woeful sandal
sweet apex
#

So its a marp problem?

woeful sandal
woeful sandal
woeful sandal
#

Remember to put the marp.exe file

#

Sorry for the inconvenience

sweet apex
#

I did everything and it works perfectly, its just that the pretty often it doesnt add images, and sometimes, not all the time, but just sometimes gives me this error @woeful sandal

#

@woeful sandal also can I dm you regarding this bot, as I like it very much but would like some extra features added for my server, maybe we can work on this and make it something crazier than what it is 🙂

sweet apex
#

When it generates more than 2 or 3 pictures from dalle, it crashes 🥲. @woeful sandal

#

The pay load is too large, how do I change the setting for that?

#

Error 4005

steel vector
#

Discord api have limit

#

Try generate only two images

woeful sandal
sweet apex
#

Can you create a compression code?

woeful sandal
#

directly

sweet apex
#

Thanks 😄

#

Can I discuss about a possible commision for another bot?

woeful sandal
# sweet apex Can you create a compression code?

ok, i'ts done, but you can directly change the code in the imagesGeneration.py file to look like this:

import requests
import os
import openai
async def generate(prompt, path, mode, openai_key):
    #r = requests.get(f"http://localhost:8000/generate_image?prompt={prompt}&path={path}")
    if mode == "sd": 
        r = requests.get(f"http://localhost:8000/generate_image?prompt={prompt}&path={path}")
        return "image generated"
    if mode == "dalle":
        openai.api_key = openai_key
        img = await openai.Image.acreate(
                prompt=prompt,
                n=1,
                size="512x512",
            )
        return img
sweet apex
#

Thanks 🙂

earnest musk
woeful sandal
#

What do you mean?

steel vector
#

thanks

thin timber
woeful sandal
thin timber
#

TY

versed compass
#

@woeful sandal following your work and tried both Stable Diffusion and Dall-E for slides

#

If there a manner to change this message right in the code?

woeful sandal
versed compass
#

How about deciding in the config to avoid putting an image on the slides? Currently reconfiguring the bot

#

So there would be no errors when the user doesn't want images
when the code literally has:
if use_images != "No": imageint = "To add an image illustration , use ![bg left:50% 70%](a-long-detailed-description-of-the-image.png) at the beginning of the slide, just after \"---\". Use only .png. It's not possible to add technical images but only illustrations. The images are generated by an ai, the name of the file should be a detailed quite long description of the image wanted. For example \" ![bg left:50% 100%](a-man-wearing-a hat-ryding-a-bicicle.png)\" but don't need to show a person necessairly."

woeful sandal
woeful sandal
#

USE_IMAGES=No

versed compass
#

"indication" should mean extra instructions or notes to the bot when creating the slides, for example, what language tone to use or which target audience the presentation is for

it should be "extra_instructions"

versed compass
#

Meanwhile, the folder where the app is placed will still produce presentation files locally. But they are not uploaded onto the Discord channel, while the error is shown.

versed compass
versed compass
woeful sandal
versed compass
woeful sandal
woeful sandal
#

new update! Added new themes and improved prompts

visual jetty
#

An error occured: Application Command raised an exception: TypeError: object OpenAIObject can't be used in 'await' expression

woeful sandal
visual jetty
#

i am getting the error every single time

visual jetty
#

before this error i am getting another error:
An error occured: Application Command raised an exception: AttributeError: type object 'Completion' has no attribute 'acreate'
i renamed the .acreate to .create in the main.py file

woeful sandal
#

Do you have different python installations on your pc?

visual jetty
#

I'm using Python 3.10

woeful sandal
visual jetty
visual jetty
visual jetty
#

i managed to generate the powerpoint

#

but so far unable to use stable diffusion yet

#

when i do this:
Open the file called Dev Console.cmd in the stable-diffusion-ui folder and run the following commands:
uvicorn main:app --reload
I am getting:
SyntaxError: invalid syntax
INFO: Stopping reloader process [3116]

woeful sandal
visual jetty
#

apparently the !DOCTYPE html tag is give syntax error
<!DOCTYPE html>
^
SyntaxError: invalid syntax

visual jetty
woeful sandal
#

also

#

did you close and reopen the webui 1 time after switching?

visual jetty
woeful sandal
#

what?

#

there is nothing html related in main.py

#

line 8 is:
#This is an API on the port 9009 that generates images from a prompt

woeful sandal
visual jetty
#

ah ok i get it now

#

so i entered uvicorn main:app --reload

#

now its at
Model loaded
INFO: Started server process [19220]
INFO: Waiting for application startup.
INFO: Application startup complete.

#

does that mean i can use the discord bot already and it will generate images in the Powerpoint?

#

my powerpoint is still plain text atm

#

managed to get a picture into the powerpoint but why is it always the man wearing a hat riding a bicycle?

#

i mean why is the picture prompt always a man wearing a hat riding a bicycle? shouldn't it be similar to the presentation prompt

woeful sandal
#

if you have anything you want/don't want, just put that in the indications.

woeful sandal
#

UPDATE
added new themes
improved large files handling, with zip files

queen beacon
#

Lets compare and see how my method is excellent for real time examples and explanations in open ai chat , using pictures, animations, ascii art, glistening/glow/etc to give you the actual animation as the explanation. ( good for schools , hospitals , etc) .. i think you took this a step further like i want to use an image generator program which is impressive nobody has done that so far. i was just about to. if you want to collaborate let me know.

woeful sandal
cloud hornet
#

Interesting

woeful sandal
#

It's simpler

patent tangle
#

imagine/Neoclassical Interior design for a large Villa living room8*12m,High3.2M,
detailed sofa Java Cream2 fabric simple detailed cushion large
glass windows night mood moon appears on the sky some night
with reflected porcelain, detailed wooden neoclassical door

storm vortex
woeful sandal
storm vortex
woeful sandal
#

?

storm vortex
woeful sandal
#

in english

storm vortex
woeful sandal
#

you have the instructions option

storm vortex