Giter VIP home page Giter VIP logo

powerpointer-for-local-llms's Introduction

PowerPointer For Local LLMs

Here is a PowerPoint generator that uses python-pptx and local llm's using the Oobabooga Text Generation WebUI api to generate beautiful and informative presentations. PowerPointer "For Local LLMs" is a port from my main PowerPointer which uses the GPT 3.5 Turbo OpenAI API: Powerpointer

The goal was to have this running completely local with no costs using for example a LLaMA based model. You can support this by giving this repo a star!

Features

  • Powerpointer doesn't use MARP. It directly creates the powerpoints so you can easily make changes to them or finish it within PowerPoint
  • It also makes placeholders for images
  • You can select between 7 designs to make the PowerPoints more beautiful
  • Runs locally on your computer so there are no privacy concerns

How it works:

  • It asks the user about the informations of the PowerPoint
  • Then it generates the text for the PowerPoint using some optimized prompts and the text generation webui api
  • The python-pptx library converts the generated text using my PowerPoint format into a PowerPoint presentation

How to use this:

To make this work, clone the repository and install the following packages:

pip install python-pptx regex collection

After this, start your oobabooga text generation webui instance with an instruct finetuned model and the api extension (--extensions api). 13B models and upwards work the best but you sometimes also receive good output with 7B models. When using 7B models, try instruct tuned Mistral models.

If you run oobabooga on a remote machine or not on a different port/ip, you have to open powerpointer.py and change the HOST or URL variable. While you are there, also make sure that the model_type (Prompt Template is set correctly.

Finally start the powerpoint generator by running:

python3 powerpointer.py 

Available Prompt Templates

I optimized the prompts to work with instruction tuned models. You can select the prompt format type in the powerpointer.py file. If your desired format is missing, you can create a new prompt format template in the prompts.py file.

Following prompt templates are available out of the box:

  • Alpaca
  • ChatML
  • Vicuna
  • Llama2Chat

Feel free to PR new ones!

Current best model

As of today (14.02.2024) I recommend to use Nous Hermes Mixtral 8x7b DPO as this yields the best results:

Keep in mind that this is quite a big model and requires a good computer to run. If you're looking for a smaller model, I can recommend Hermes Theta 8B:

Both model use ChatML as prompt templates.

Known issues:

Because of the limitation of "small and sometimes dumb" local models:

  • the generator easily hallucinates things
  • the generator sometimes ignores the selected slide count
  • the generator sometimes forgets to include the additional info

Because of my "pro" code:

  • it's complicated to add new templates. I'm searching for an easier way

Please report any issues and feel free to make a pull request to fix my code I wrote at night.

Made by CyberTimon ([email protected])

Demo screenshots:

Here are some screenshots from the local generated powerpoints:

alt text alt text alt text

powerpointer-for-local-llms's People

Contributors

cybertimon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerpointer-for-local-llms's Issues

Index out of bound errors

Hi there,

First off, thank you for creating this...the potential I can see of it where I work is incredible!

However, I am seeing the same error frequently: File "/home/ec2-user/SageMaker/.cs/conda/envs/textgen/lib/python3.10/site-packages/transformers/models/gptj/modeling_gptj.py", line 223, in forward
sincos = torch.gather(embed_positions, 1, repeated_position_ids)
RuntimeError: index 2048 is out of bounds for dimension 1 with size 2048

I am running this on AWS Sagemaker on a CPU backed instance (yet to try on a GPU, but will later on) and following your example with AI as the topic I am always greeted with this error. Any ideas?! I am able to run the textegeneration API running ok (I think):

(textgen) [ec2-user@ip-10-10-1-139 text-generation-webui]$ python server.py --api --model eleutherai_gpt-j-6b --model-dir ../text-generation-webui/models/ --verbose --cpu --load-in-8bit
/home/ec2-user/SageMaker/.cs/conda/envs/textgen/lib/python3.10/site-packages/torch/cuda/init.py:546: UserWarning: Can't initialize NVML
warnings.warn("Can't initialize NVML")
INFO:Loading eleutherai_gpt-j-6b...
INFO:Loaded the model in 25.50 seconds.

Help?
Cheers,
Dan

to add new templates

"it's complicated to add new templates. I'm searching for an easier way". i want to add the new slide ,but i don't know how to do it If you know how to do it, please tell me

ERROR

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /api/v1/generate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff4af6e6640>: Failed to establish a new connection: [Errno 111] Connection refused'))

Thank You!

Not an Issue, just wanted to say thank you for this! It's very easy to use and runs very well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.