hackathon / README.md
angkit007's picture
Update README.md
ebe7e08 verified
|
Raw
History Blame Contribute Delete
3.6 kB
---
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)