-
Notifications
You must be signed in to change notification settings - Fork 293
[Model] add openai compatible API interface #546
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Adjust API client initialization for OpenAI and Azure. - Modify image encoding to handle size limits and maintain aspect ratio. - Add new `OpenAICompatible` model class. - Introduce retry mechanism for API requests with configurable retries. - Update `.gitignore` to exclude `.env` and `scripts/`. .gitignore: - Exclude `.env` file for security. - Ensure no scripts directory is tracked. lmms_eval/models/gpt4v.py: - Refactor API client initialization to use new OpenAI and Azure clients. - Update image encoding to handle size limits with resizing logic. - Adjust retry logic for API calls, reducing sleep time. lmms_eval/models/openai_compatible.py: - Create new `OpenAICompatible` model class with similar structure. - Implement encoding functions for images and videos. - Integrate environment variable loading and persistent response caching. miscs/model_dryruns/openai_compatible.sh: - Add sample script for running the new model.
- Remove unused import for deepcopy in `openai_compatible.py`. - Add a blank line for better separation of code sections. - Adjust comment formatting for `max_size_in_mb` for consistency. - Ensure consistent spacing around comments. File: `lmms_eval/models/openai_compatible.py` - Removed `deepcopy` import: cleaned up unnecessary code. - Added blank line after `load_dotenv`: improved readability. - Reformatted comment on `max_size_in_mb`: enhanced clarity. - Removed extra blank line before `Accelerator`: tightened spacing.
1a60a35
to
e0aa1c7
Compare
kcz358
approved these changes
Feb 20, 2025
AttributeError: 'OpenAICompatible' object has no attribute 'max_frames_num' |
MichalCiesiolka
pushed a commit
to MichalCiesiolka/lmms-eval-llmzszl
that referenced
this pull request
Apr 3, 2025
* Update API usage and add environment configuration - Adjust API client initialization for OpenAI and Azure. - Modify image encoding to handle size limits and maintain aspect ratio. - Add new `OpenAICompatible` model class. - Introduce retry mechanism for API requests with configurable retries. - Update `.gitignore` to exclude `.env` and `scripts/`. .gitignore: - Exclude `.env` file for security. - Ensure no scripts directory is tracked. lmms_eval/models/gpt4v.py: - Refactor API client initialization to use new OpenAI and Azure clients. - Update image encoding to handle size limits with resizing logic. - Adjust retry logic for API calls, reducing sleep time. lmms_eval/models/openai_compatible.py: - Create new `OpenAICompatible` model class with similar structure. - Implement encoding functions for images and videos. - Integrate environment variable loading and persistent response caching. miscs/model_dryruns/openai_compatible.sh: - Add sample script for running the new model. * Improve code readability and organization - Remove unused import for deepcopy in `openai_compatible.py`. - Add a blank line for better separation of code sections. - Adjust comment formatting for `max_size_in_mb` for consistency. - Ensure consistent spacing around comments. File: `lmms_eval/models/openai_compatible.py` - Removed `deepcopy` import: cleaned up unnecessary code. - Added blank line after `load_dotenv`: improved readability. - Reformatted comment on `max_size_in_mb`: enhanced clarity. - Removed extra blank line before `Accelerator`: tightened spacing. * Fix init --------- Co-authored-by: kcz358 <[email protected]>
dadwadw233
pushed a commit
to dadwadw233/lmms-eval
that referenced
this pull request
Apr 28, 2025
* Update API usage and add environment configuration - Adjust API client initialization for OpenAI and Azure. - Modify image encoding to handle size limits and maintain aspect ratio. - Add new `OpenAICompatible` model class. - Introduce retry mechanism for API requests with configurable retries. - Update `.gitignore` to exclude `.env` and `scripts/`. .gitignore: - Exclude `.env` file for security. - Ensure no scripts directory is tracked. lmms_eval/models/gpt4v.py: - Refactor API client initialization to use new OpenAI and Azure clients. - Update image encoding to handle size limits with resizing logic. - Adjust retry logic for API calls, reducing sleep time. lmms_eval/models/openai_compatible.py: - Create new `OpenAICompatible` model class with similar structure. - Implement encoding functions for images and videos. - Integrate environment variable loading and persistent response caching. miscs/model_dryruns/openai_compatible.sh: - Add sample script for running the new model. * Improve code readability and organization - Remove unused import for deepcopy in `openai_compatible.py`. - Add a blank line for better separation of code sections. - Adjust comment formatting for `max_size_in_mb` for consistency. - Ensure consistent spacing around comments. File: `lmms_eval/models/openai_compatible.py` - Removed `deepcopy` import: cleaned up unnecessary code. - Added blank line after `load_dotenv`: improved readability. - Reformatted comment on `max_size_in_mb`: enhanced clarity. - Removed extra blank line before `Accelerator`: tightened spacing. * Fix init --------- Co-authored-by: kcz358 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update API usage and add environment configuration
OpenAICompatible
model class to support more variants models as long as they support openai format API..gitignore
to exclude.env
andscripts/
..gitignore:
.env
file for security.lmms_eval/models/gpt4v.py: