File size: 1,491 Bytes
d358d45
 
 
 
 
 
a7eca70
d358d45
 
 
6f03778
d358d45
a7eca70
d358d45
6f03778
d358d45
6f03778
 
 
 
 
 
 
 
d358d45
6f03778
 
 
a7eca70
d358d45
6f03778
d358d45
6f03778
 
 
d358d45
6f03778
d358d45
6f03778
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
title: meme-generator (Docker)
emoji: 😎
colorFrom: purple
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false
---

# Hugging Face Space for ghcr.io/1111qwq1111/meme-generator:latest

This Space wraps your published image and adapts it for Spaces (listening on `$PORT`, default 7860). It also supports translator env variables via Space Secrets.

## How to use

- Create a new Space and choose “Docker” as the SDK.
- Push the files from this `hf-space` folder to the Space repo root.
- In the Space settings, add Secrets:
  - `TRANSLATOR_PROVIDER` = `openai`
  - `OPENAI_BASE_URL` = `https://api.openai.com/v1`
  - `OPENAI_API_KEY` = `sk-***` (do not hardcode)
  - `OPENAI_MODEL` = `gpt-4.1-mini`
  - (Optionally) `MEME_DATA_DIR` if you want a custom data path; default `/app/data`.

The container will:
- Ensure built-in memes load after the translator monkey‑patch.
- Use your OpenAI‑compatible translator if envs are present, otherwise fallback to upstream behavior.
- Bind the server to `$PORT` (7860 by default on Spaces).

## Endpoints

- OpenAPI docs: `/docs`
- Meme APIs: `/memes/<key>/` (POST), e.g. `/memes/dianzhongdian/`
- Aggregated metadata (if available): `/memes/static/infos.json`, `/memes/static/keyMap.json`

## Notes

- This wrapper assumes your base image provides the Python package `meme_generator` and contributions under `/app/meme-generator-contrib` and `/app/meme_emoji`.
- No secrets are baked into the image; configure them via Space Secrets.