| --- |
| 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 : |
|  |
|
|
| Sad mood: |
|  |
|
|
| Tense mood: |
|  |
|
|
|
|