Giter VIP home page Giter VIP logo

infinitegpt's Introduction

InfiniteGPT ๐Ÿš€

InfiniteGPT is a Python script that lets you input an unlimited size text into the OpenAI API. No more tedious copy & pasting. It's a single python script that can connect to any of the OpenAI API chat models (gpt-3.5-turbo, gpt4, etc.).

This eliminates the need for re-prompting when using a large text input or copying and pasting endless chunks of text into chatGPT. ๐Ÿ“š

Dependencies ๐Ÿ“ฆ

  • python3
  • openai

BYOK (Bring Your Own Keys!) ๐Ÿ”‘

Go to OpenAI to get your personal API keys.

This script does not hide your API keys, so please do so if you plan on integrating it into a public application. โš ๏ธ

Usage ๐Ÿ› ๏ธ

  1. Clone the repository
  2. Install the required dependencies
  3. Add your API keys
  4. Run the script

License ๐Ÿ“„

MIT License. See LICENSE for more information.

Connect with me ๐Ÿ“ฃ

I write about using AI tools & share my latest building on Twitter @ehalm_. DM me with any questions. ๐Ÿฆ

Happy building! ๐ŸŽ‰

infinitegpt's People

Contributors

emmethalm 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  avatar  avatar  avatar  avatar  avatar

infinitegpt's Issues

Give a brief overview of how that actually works

It's unclear how you achieve that and looking at other issues it seems there might be a discrepancy on expectations.

A brief overview of what the script actually does would help narrow down what use cases it serves

`blastoff.py` should be converted to a class `InfiniteGpt`

Acceptance Criteria

  • __main__ should be re-written as run(...) that consumes an input and output file
  • configure(...) should be written to consume
  • All other functions (helpers) should be given underscore notation (ex: _split_into_chunks(...)) as syntactic sugar to denote that they are private
  • All functions should be wrapped in an InfiniteGpt class

Practical usage example

To me its unclear how this fixes the problem of max prompt length. Let's say I have the following prompt:

=== PROMPT-start ===
I will provide you with the full text of a unrealeased book called "my unreleased book". Please 
create a short summary of the whole book in 200 words:
Lore ipsum....
...
...
...
(full book which has 100'000 tokens) 
=== PROMPT-end ===

In that case this script will get a response from chatGPT every 1500 tokens and screw up my prompt right?

Or maybe I did not understood the benefit of this script? Can you name one practical example how to use this script?

not work

openai.error.InvalidRequestError: This model's maximum context length is 4097 tokens. However, you requested 4972 tokens (3222 in the messages, 1750 in the completion). Please reduce the length of the messages or completion.

Script allows sending 'infinite' amounts of text, but without context/memory

So looking through the script, basically, your code takes a text document, breaks it into pieces, matching tokens (And I am still trying to figure out how you get accurate token count for the openai API without using tiktoken or similar library) and sending each piece separately to the API )And with the ability to set a system message and/or prompt with each chunk) So yeah, in a way you are able to send near infinite texts to the API

But that does not change the underlying issue that the openai API models lack the conversationalbuffermemory that ChatGPT has, so each of those chunks would get treated and responded to without any inherent context or identification with any of the other chunks you send, so even if you would get replies, none of them would make any sense for the whole, as none of those would actually ever understand the full text sent, only the individual chunk sent in that call to it.

I mean, I guess i see the benefit of this script if you want to hit the rate limits of your gpt-4 API access, but other than that? Could you provide a sensible use-case for this script please? Also, for the sake of transparency and openness, I think you should mention the detail that the API can't connect the chunks and will only respond on an individual basis, as there seems to be some confusion regarding the true capabilities of your script.

The chunk may not be working as intended.

The following error was returned:
"InvalidRequestError: This model's maximum context length is 4097 tokens. However, your messages resulted in 9203 tokens. Please reduce the length of the messages."

Is that it?

This is what you claimed:
image

This is not what this repo does.

This repo barely does anything - it just sends the data in chunks, it's barely a "hello world" for the api..
GPT still loses the context in the exact same way, I have no idea what the utility of this is, the "README.md" seems to have more effort put into it than the code.

I wouldn't come to knock down a random small repo, but this has 250(!) stars and was featured in the gpt superpower newsletter.
I honestly don't get it.

split by paragraph function

Hello

I think it would improve the quality of the chatGPT output if the content is split by paragraphs and not by words. It will prevent the cutting off in the middle of a sentence and thus losing some meaning in the beginning and ending of each chunk

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.