Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GPT-4 Vision Support & Token Counter #418

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

duysqubix
Copy link

Great project, not sure if its dead or not.. but with the new vision preview models. I have modified the original codebase to support vision by supplying a --image option. Only works with the gpt-4-vision-preview model, supports both local images and URLs.

Also added an extra dependency that estimates the number of tokens.

duysqubix and others added 12 commits July 31, 2023 18:46
…ompt in sgpt/app.py, refactor lists in pyproject.toml"

This commit introduces the 'tiktoken' dependency in the pyproject.toml file and adds functionality to calculate the number of tokens for a given prompt in the sgpt/app.py file. This is done by adding a new 'tokenize' option in the main function.
   - Changed the working directory and copy destination to /home/app for better organization and to follow best practices.
   - Added a step to create a new user 'app' and switch to it for security reasons, as running the Docker container as root can be a security risk.

2. sgpt/__init__.py:
   - Imported Optional from typing to support optional typing in the code, improving code readability and maintainability.

3. sgpt/app.py:
   - Imported rich library and typing for better console output formatting and type hinting.
   - Replaced typer.echo with rich.print for better console output formatting.
   - Removed a comment that was not providing any additional information.

4. sgpt/config.py:
   - Imported Console from rich for better console output formatting.
   - Added a new configuration variable 'FORCE_COLOR' to allow users to force color output in the console.
   - Added a method to initialize a Console object with the appropriate color system based on the 'FORCE_COLOR' configuration variable.

5. sgpt/role.py:
   - Imported print from rich for better console output formatting.
   - Replaced typer.echo with rich.print for better console output formatting.

6. sgpt/utils.py:
   - Imported print from rich for better console output formatting.
   - Replaced typer.echo with rich.print for better console output formatting.
@luandro
Copy link

luandro commented Jan 13, 2024

Would be great to have vision available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants