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
| """ | |
| LiteLLM Custom Provider for your LLM Gateway | |
| Installation: | |
| 1. Place this file in your project directory | |
| 2. Update litellm's openai_compatible_providers.json OR | |
| 3. Use the CustomLLM class approach for full control | |
| Usage: | |
| import litellm |
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
| import asyncio | |
| import datetime | |
| import inspect | |
| import os | |
| import threading | |
| try: | |
| import psutil | |
| IS_PSUTIL = True | |
| except ImportError: | |
| psutil = None |
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
| import streamlit as st | |
| from content_gen import PipelineManager | |
| # from toolboxv2.utils.toolbox import ProxyApp | |
| def main(): | |
| manager = PipelineManager() | |
| st.sidebar.title("Generation Tasks") | |
| task = st.sidebar.selectbox("Select a task", ["Classic Generation", "Tiny Generation", "Text-to-Image Generation", |
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
| # cli_functions.py | |
| # pip install git+https://github.com/huggingface/accelerate | |
| import os | |
| from diffusers import (StableDiffusionPipeline, AutoencoderTiny, AutoPipelineForText2Image, AutoPipelineForImage2Image, \ | |
| StableDiffusionXLPipeline, StableDiffusionXLImg2ImgPipeline, DiffusionPipeline, LCMScheduler, \ | |
| AutoPipelineForInpainting, StableDiffusionControlNetPipeline, ControlNetModel, | |
| AnimateDiffPipeline, | |
| MotionAdapter, StableVideoDiffusionPipeline) | |
| from diffusers.utils import load_image, make_image_grid, export_to_gif, export_to_video |