CoolFace
Apppublic

EditsPaarth/PowerPoint-AI

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
global_config.py80 linesDownload Raw Back to root
1"""2A set of configurations used by the app.3"""4import logging5import os6 7from dataclasses import dataclass8from dotenv import load_dotenv9 10 11load_dotenv()12 13 14@dataclass(frozen=True)15class GlobalConfig:16    """17    A data class holding the configurations.18    """19 20    HF_LLM_MODEL_NAME = 'mistralai/Mistral-Nemo-Instruct-2407'21    LLM_MODEL_TEMPERATURE = 0.222    LLM_MODEL_MIN_OUTPUT_LENGTH = 10023    LLM_MODEL_MAX_OUTPUT_LENGTH = 4 * 4096  # tokens24    LLM_MODEL_MAX_INPUT_LENGTH = 400  # characters25 26    HUGGINGFACEHUB_API_TOKEN = os.environ.get('HUGGINGFACEHUB_API_TOKEN', '')27 28    LOG_LEVEL = 'DEBUG'29    COUNT_TOKENS = False30    APP_STRINGS_FILE = 'strings.json'31    PRELOAD_DATA_FILE = 'examples/example_02.json'32    SLIDES_TEMPLATE_FILE = 'langchain_templates/template_combined.txt'33    INITIAL_PROMPT_TEMPLATE = 'langchain_templates/chat_prompts/initial_template_v4_two_cols_img.txt'34    REFINEMENT_PROMPT_TEMPLATE = 'langchain_templates/chat_prompts/refinement_template_v4_two_cols_img.txt'35 36    LLM_PROGRESS_MAX = 9037    ICONS_DIR = 'icons/png128/'38    TINY_BERT_MODEL = 'gaunernst/bert-mini-uncased'39    EMBEDDINGS_FILE_NAME = 'file_embeddings/embeddings.npy'40    ICONS_FILE_NAME = 'file_embeddings/icons.npy'41 42    PPTX_TEMPLATE_FILES = {43        'Basic': {44            'file': 'pptx_templates/Blank.pptx',45            'caption': 'A good start 🟧'46        },47        'Minimalist Sales Pitch': {48            'file': 'pptx_templates/Minimalist_sales_pitch.pptx',49            'caption': 'In high contrast ⬛'50        },51        'Ion Boardroom': {52            'file': 'pptx_templates/Ion_Boardroom.pptx',53            'caption': 'Make some bold decisions 🟥'54        },55        'Urban Monochrome': {56            'file': 'pptx_templates/Urban_monochrome.pptx',57            'caption': 'Marvel in a monochrome dream ⬜'58        },59    }60 61    # This is a long text, so not incorporated as a string in `strings.json`62    CHAT_USAGE_INSTRUCTIONS = (63        'Briefly describe your topic of presentation in the textbox provided below.'64        ' For example:\n'65        '- Make a slide deck on AI.'66        '\n\n'67        'Subsequently, you can add follow-up instructions, e.g.:\n'68        '- Can you add a slide on GPUs?'69        '\n\n'70        ' You can also ask it to refine any particular slide, e.g.:\n'71        '- Make the slide with title \'Examples of AI\' a bit more descriptive.'72    )73 74 75logging.basicConfig(76    level=GlobalConfig.LOG_LEVEL,77    format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',78    datefmt='%Y-%m-%d %H:%M:%S'79)80