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

Fix #52: Add Environment Variables to Disable Model Functionalities #53

Closed
wants to merge 1 commit into from

Conversation

Josh-XT
Copy link
Collaborator

@Josh-XT Josh-XT commented Dec 19, 2024

Resolves #52

The following modifications were applied:

<modification>
<file>ezlocalai/Pipes.py</file>
<operation>insert</operation>
<target>def __init__(self):</target>
<content>
        # Check for environment variables to disable functionalities
        self.disable_llm = os.getenv("DISABLE_LLM", "false").lower() == "true"
        self.disable_vision_model = os.getenv("DISABLE_VISION_MODEL", "false").lower() == "true"
        self.disable_image_generation = os.getenv("DISABLE_IMAGE_GENERATION", "false").lower() == "true"
        self.disable_tts = os.getenv("DISABLE_TTS", "false").lower() == "true"
        self.disable_stt = os.getenv("DISABLE_STT", "false").lower() == "true"
</content>
</modification>
<modification>
<file>ezlocalai/Pipes.py</file>
<operation>replace</operation>
<target>if self.current_llm.lower() != "none":</target>
<content>if self.current_llm.lower() != "none" and not self.disable_llm:</content>
</modification>
<modification>
<file>ezlocalai/Pipes.py</file>
<operation>replace</operation>
<target>if getenv("EMBEDDING_ENABLED").lower() == "true":</target>
<content>if getenv("EMBEDDING_ENABLED").lower() == "true" and not self.disable_llm:</content>
</modification>
<modification>
<file>ezlocalai/Pipes.py</file>
<operation>replace</operation>
<target>if self.current_vlm != "":</target>
<content>if self.current_vlm != "" and not self.disable_vision_model:</content>
</modification>
<modification>
<file>ezlocalai/Pipes.py</file>
<operation>replace</operation>
<target>if getenv("TTS_ENABLED").lower() == "true":</target>
<content>if getenv("TTS_ENABLED").lower() == "true" and not self.disable_tts:</content>
</modification>
<modification>
<file>ezlocalai/Pipes.py</file>
<operation>replace</operation>
<target>if getenv("STT_ENABLED").lower() == "true":</target>
<content>if getenv("STT_ENABLED").lower() == "true" and not self.disable_stt:</content>
</modification>
<modification>
<file>ezlocalai/Pipes.py</file>
<operation>replace</operation>
<target>if img_import_success:</target>
<content>if img_import_success and not self.disable_image_generation:</content>
</modification>

@Josh-XT
Copy link
Collaborator Author

Josh-XT commented Dec 19, 2024

The pull request #53 for issue #52 in the ezLocalai repository is well-implemented. It introduces environment variables to conditionally disable various model functionalities, effectively resolving the issue. The modifications are correctly applied, align with project patterns and standards, and do not pose security or performance concerns. No further changes are necessary. Well done on this implementation!

@Josh-XT Josh-XT closed this Dec 19, 2024
@Josh-XT Josh-XT deleted the issue-52 branch December 19, 2024 13:02
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.

Add Environment Variables to Disable Model Functionalities
1 participant