--- title: Emberglade emoji: ๐Ÿฑ colorFrom: yellow colorTo: green sdk: gradio sdk_version: 6.18.0 app_file: app_single.py pinned: false short_description: 'Emberglade is a emotion identifier. ' --- # Emberglade ยท MiniCPM-V 4.6 Bad days happen. We get stressed, overwhelmed, or just plain sad. But what if your computer could actually cheer you up?" We built Emberglade with one single mission: to scan your negative moods and completely flip them upside down into pure joy. API-powered image description using OpenBMB's hosted MiniCPM-V 4.6. No model download. No GPU. Works on any machine with internet access. It can run without internet access also if you download the models --- ## Submissioin details: ``` Spaces : https://huggingface.co/spaces/angkit007/hackathon ``` ``` Social media(youtube)): https://www.youtube.com/watch?v=QXYqQWdU2jc ``` ``` Social media(facebook) : https://www.facebook.com/share/p/1JCppAFppP/ ``` --- ## Quick start ```bash pip install -r requirements.txt python main.py # โ†’ http://localhost:7860 ``` --- ## File structure ``` minicpm_app/ โ”œโ”€โ”€ main.py โ† entry point (python main.py) โ”œโ”€โ”€ requirements.txt โ”‚ โ”œโ”€โ”€ config/ โ”‚ โ”œโ”€โ”€ __init__.py โ”‚ โ””โ”€โ”€ settings.py โ† API URL, keys, model IDs, defaults โ”‚ โ”œโ”€โ”€ core/ โ”‚ โ”œโ”€โ”€ __init__.py โ”‚ โ”œโ”€โ”€ api_client.py โ† streaming API call + error handling โ”‚ โ””โ”€โ”€ image_utils.py โ† PIL โ†’ JPEG โ†’ base64 data URL โ”‚ โ””โ”€โ”€ ui/ โ”œโ”€โ”€ __init__.py โ”œโ”€โ”€ app.py โ† Gradio layout (build_ui) โ””โ”€โ”€ components.py โ† individual input/output widgets ``` --- ## Models | Model | Params | Best for | | ------------------------ | ------ | -------------------------------- | | `MiniCPM-V-4.6-Instruct` | 1.3 B | Fast Q&A, direct descriptions | | `MiniCPM-V-4.6-Thinking` | 1.3 B | Complex reasoning, OCR, analysis | Both are well under the 32 B parameter cap. --- ## API key A **free public key** is baked into `config/settings.py` โ€” works immediately, no signup. For higher rate limits, get a personal key at https://modelbest.cn and either: - Paste it in the **API Key** field in the UI, or - Set the environment variable: ```bash export MINICPM_API_KEY=sk-your-key-here python main.py ``` Priority: `MINICPM_API_KEY` env var โ†’ UI field โ†’ public fallback key. --- ## Extending | Task | File to edit | | ---------------------------- | ---------------------------------------- | | Change model / add new model | `config/settings.py` โ†’ `MODELS` dict | | Adjust defaults | `config/settings.py` โ†’ `DEFAULT_*` | | Change API endpoint | `config/settings.py` โ†’ `API_BASE_URL` | | Add retry logic / logging | `core/api_client.py` | | Add new UI widgets | `ui/components.py` + wire in `ui/app.py` | ## Examples There are different moodes like "happy","sad","calm","energetic","mysterious","depressed","romantic","tense","nostalgic","angry" and neutral". Some of them are shown below: Happy mood : ![image](https://cdn-uploads.huggingface.co/production/uploads/6a205bfe62f7c20bc7f5d441/0-0xU8ZoUHm7dgutdvQSb.png) Sad mood: ![image](https://cdn-uploads.huggingface.co/production/uploads/6a205bfe62f7c20bc7f5d441/zq8pbne1lVF3W34pUU7_O.png) Tense mood: ![image](https://cdn-uploads.huggingface.co/production/uploads/6a205bfe62f7c20bc7f5d441/5rZaxpkH71XJqes5xtV1D.png)