Spaces:
Sleeping
Sleeping
Commit
·
de89ca4
1
Parent(s):
69fda13
feat: 同步https://github.com/MeetWq/meme-generator/releases/tag/v0.0.18
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitignore +1 -0
- .pre-commit-config.yaml +22 -11
- Dockerfile +1 -1
- README.md +1 -0
- docker/config.toml.template +1 -1
- docs/develop.md +0 -1
- docs/docker.md +9 -12
- docs/images/bluearchive.jpg +0 -0
- docs/images/certificate.png +3 -0
- docs/images/clown.png +3 -0
- docs/images/clown_instance0.png +3 -0
- docs/images/clown_instance1.png +3 -0
- docs/images/daynight.jpg +0 -0
- docs/images/dog_dislike.gif +3 -0
- docs/images/dog_dislike_instance0.gif +3 -0
- docs/images/dog_dislike_instance1.gif +3 -0
- docs/images/frieren_take.jpg +0 -0
- docs/images/lim_x_0.jpg +0 -0
- docs/images/listen_music.gif +3 -0
- docs/images/little_angel.jpg +0 -0
- docs/images/loading.jpg +0 -0
- docs/images/look_flat.jpg +0 -0
- docs/images/look_this_icon.jpg +0 -0
- docs/images/lost_dog.jpg +0 -0
- docs/images/love_you.gif +3 -0
- docs/images/luoyonghao_say.jpg +0 -0
- docs/images/luxun_say.jpg +0 -0
- docs/images/maikease.gif +3 -0
- docs/images/maimai_awaken.jpg +0 -0
- docs/images/maimai_join.jpg +0 -0
- docs/images/make_friend.jpg +0 -0
- docs/images/marriage.jpg +0 -0
- docs/images/meteor.jpg +0 -0
- docs/images/mihoyo.png +3 -0
- docs/images/mourning.jpg +0 -0
- docs/images/mourning_instance0.jpg +0 -0
- docs/images/mourning_instance1.jpg +0 -0
- docs/images/murmur.jpg +0 -0
- docs/images/my_friend.jpg +0 -0
- docs/images/my_wife.jpg +0 -0
- docs/images/name_generator.jpg +0 -0
- docs/images/need.jpg +0 -0
- docs/images/nekoha_holdsign.jpg +0 -0
- docs/images/nihaosaoa.gif +3 -0
- docs/images/nijika_holdsign.jpg +0 -0
- docs/images/no_response.jpg +0 -0
- docs/images/nokia.jpg +0 -0
- docs/images/not_call_me.png +3 -0
- docs/images/note_for_leave.jpg +0 -0
- docs/images/oshi_no_ko.png +3 -0
.gitignore
CHANGED
|
@@ -4,6 +4,7 @@ dist/
|
|
| 4 |
.idea/
|
| 5 |
venv/
|
| 6 |
.venv/
|
|
|
|
| 7 |
|
| 8 |
result.png
|
| 9 |
result.jpg
|
|
|
|
| 4 |
.idea/
|
| 5 |
venv/
|
| 6 |
.venv/
|
| 7 |
+
pdm.lock
|
| 8 |
|
| 9 |
result.png
|
| 10 |
result.jpg
|
.pre-commit-config.yaml
CHANGED
|
@@ -1,26 +1,37 @@
|
|
| 1 |
-
default_install_hook_types: [pre-commit, prepare-commit-msg]
|
| 2 |
ci:
|
| 3 |
-
autofix_commit_msg: ":
|
| 4 |
autofix_prs: true
|
| 5 |
-
autoupdate_branch:
|
| 6 |
-
autoupdate_schedule:
|
| 7 |
-
autoupdate_commit_msg: ":
|
| 8 |
repos:
|
| 9 |
-
- repo: https://github.com/
|
| 10 |
-
rev:
|
| 11 |
hooks:
|
| 12 |
-
- id:
|
| 13 |
-
args: [--
|
|
|
|
| 14 |
|
| 15 |
- repo: https://github.com/pycqa/isort
|
| 16 |
-
rev: 5.
|
| 17 |
hooks:
|
| 18 |
- id: isort
|
| 19 |
stages: [commit]
|
| 20 |
|
| 21 |
- repo: https://github.com/psf/black
|
| 22 |
-
rev: 23.1
|
| 23 |
hooks:
|
| 24 |
- id: black
|
| 25 |
stages: [commit]
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ci:
|
| 2 |
+
autofix_commit_msg: "style: auto fix by pre-commit hooks"
|
| 3 |
autofix_prs: true
|
| 4 |
+
autoupdate_branch: main
|
| 5 |
+
autoupdate_schedule: quarterly
|
| 6 |
+
autoupdate_commit_msg: "chore: auto update by pre-commit hooks"
|
| 7 |
repos:
|
| 8 |
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
| 9 |
+
rev: v0.1.9
|
| 10 |
hooks:
|
| 11 |
+
- id: ruff
|
| 12 |
+
args: [--fix, --exit-non-zero-on-fix]
|
| 13 |
+
stages: [commit]
|
| 14 |
|
| 15 |
- repo: https://github.com/pycqa/isort
|
| 16 |
+
rev: 5.13.2
|
| 17 |
hooks:
|
| 18 |
- id: isort
|
| 19 |
stages: [commit]
|
| 20 |
|
| 21 |
- repo: https://github.com/psf/black
|
| 22 |
+
rev: 23.12.1
|
| 23 |
hooks:
|
| 24 |
- id: black
|
| 25 |
stages: [commit]
|
| 26 |
|
| 27 |
+
- repo: https://github.com/pre-commit/mirrors-prettier
|
| 28 |
+
rev: v4.0.0-alpha.8
|
| 29 |
+
hooks:
|
| 30 |
+
- id: prettier
|
| 31 |
+
types_or: [javascript, jsx, ts, tsx, markdown, yaml, json]
|
| 32 |
+
stages: [commit]
|
| 33 |
+
exclude: |
|
| 34 |
+
(?x)^(
|
| 35 |
+
resources/resource_list.json|
|
| 36 |
+
docs/memes.md
|
| 37 |
+
)$
|
Dockerfile
CHANGED
|
@@ -13,7 +13,7 @@ FROM python:3.10-slim as app
|
|
| 13 |
|
| 14 |
WORKDIR /app
|
| 15 |
|
| 16 |
-
EXPOSE
|
| 17 |
|
| 18 |
VOLUME /data
|
| 19 |
|
|
|
|
| 13 |
|
| 14 |
WORKDIR /app
|
| 15 |
|
| 16 |
+
EXPOSE 2233
|
| 17 |
|
| 18 |
VOLUME /data
|
| 19 |
|
README.md
CHANGED
|
@@ -4,6 +4,7 @@ emoji: 🌖
|
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
|
|
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 2233
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
docker/config.toml.template
CHANGED
|
@@ -13,7 +13,7 @@ baidu_trans_apikey = "$BAIDU_TRANS_APIKEY"
|
|
| 13 |
|
| 14 |
[server]
|
| 15 |
host = "0.0.0.0"
|
| 16 |
-
port =
|
| 17 |
|
| 18 |
[log]
|
| 19 |
log_level = "$LOG_LEVEL"
|
|
|
|
| 13 |
|
| 14 |
[server]
|
| 15 |
host = "0.0.0.0"
|
| 16 |
+
port = 2233
|
| 17 |
|
| 18 |
[log]
|
| 19 |
log_level = "$LOG_LEVEL"
|
docs/develop.md
CHANGED
|
@@ -72,7 +72,6 @@ add_meme(
|
|
| 72 |
|
| 73 |
也可以一个文件中注册多个表情,如:[gif_subtitle](../meme_generator/memes/gif_subtitle/__init__.py)
|
| 74 |
|
| 75 |
-
|
| 76 |
## 参数定义
|
| 77 |
|
| 78 |
部分表情需要额外的参数。表情参数的类型定义如下:
|
|
|
|
| 72 |
|
| 73 |
也可以一个文件中注册多个表情,如:[gif_subtitle](../meme_generator/memes/gif_subtitle/__init__.py)
|
| 74 |
|
|
|
|
| 75 |
## 参数定义
|
| 76 |
|
| 77 |
部分表情需要额外的参数。表情参数的类型定义如下:
|
docs/docker.md
CHANGED
|
@@ -14,19 +14,17 @@ docker run -d \
|
|
| 14 |
|
| 15 |
运行后可通过 api 方式调用
|
| 16 |
|
| 17 |
-
|
| 18 |
### 环境变量
|
| 19 |
|
| 20 |
-
| 变量名
|
| 21 |
-
|
|
| 22 |
-
| `MEME_DIRS`
|
| 23 |
-
| `MEME_DISABLED_LIST` | `'[]'`
|
| 24 |
-
| `GIF_MAX_SIZE`
|
| 25 |
-
| `GIF_MAX_FRAMES`
|
| 26 |
-
| `BAIDU_TRANS_APPID`
|
| 27 |
-
| `BAIDU_TRANS_APIKEY` | `''`
|
| 28 |
-
| `LOG_LEVEL`
|
| 29 |
-
|
| 30 |
|
| 31 |
### 加载额外表情
|
| 32 |
|
|
@@ -36,7 +34,6 @@ docker run -d \
|
|
| 36 |
|
| 37 |
将额外表情放置于 `<YOUR_DATA_DIR>/memes` 即可
|
| 38 |
|
| 39 |
-
|
| 40 |
完整的运行示例:
|
| 41 |
|
| 42 |
```shell
|
|
|
|
| 14 |
|
| 15 |
运行后可通过 api 方式调用
|
| 16 |
|
|
|
|
| 17 |
### 环境变量
|
| 18 |
|
| 19 |
+
| 变量名 | 默认值 | 说明 |
|
| 20 |
+
| -------------------- | ------------------- | ----------------------- |
|
| 21 |
+
| `MEME_DIRS` | `'["/data/memes"]'` | 额外表情路径 |
|
| 22 |
+
| `MEME_DISABLED_LIST` | `'[]'` | 禁用表情列表 |
|
| 23 |
+
| `GIF_MAX_SIZE` | `10.0` | 限制生成的 gif 文件大小 |
|
| 24 |
+
| `GIF_MAX_FRAMES` | `100` | 限制生成的 gif 文件帧数 |
|
| 25 |
+
| `BAIDU_TRANS_APPID` | `''` | 百度翻译 appid |
|
| 26 |
+
| `BAIDU_TRANS_APIKEY` | `''` | 百度翻译 apikey |
|
| 27 |
+
| `LOG_LEVEL` | `'INFO'` | 日志等级 |
|
|
|
|
| 28 |
|
| 29 |
### 加载额外表情
|
| 30 |
|
|
|
|
| 34 |
|
| 35 |
将额外表情放置于 `<YOUR_DATA_DIR>/memes` 即可
|
| 36 |
|
|
|
|
| 37 |
完整的运行示例:
|
| 38 |
|
| 39 |
```shell
|
docs/images/bluearchive.jpg
ADDED
|
docs/images/certificate.png
ADDED
|
Git LFS Details
|
docs/images/clown.png
ADDED
|
Git LFS Details
|
docs/images/clown_instance0.png
ADDED
|
Git LFS Details
|
docs/images/clown_instance1.png
ADDED
|
Git LFS Details
|
docs/images/daynight.jpg
ADDED
|
docs/images/dog_dislike.gif
ADDED
|
Git LFS Details
|
docs/images/dog_dislike_instance0.gif
ADDED
|
Git LFS Details
|
docs/images/dog_dislike_instance1.gif
ADDED
|
Git LFS Details
|
docs/images/frieren_take.jpg
ADDED
|
docs/images/lim_x_0.jpg
ADDED
|
docs/images/listen_music.gif
ADDED
|
Git LFS Details
|
docs/images/little_angel.jpg
ADDED
|
docs/images/loading.jpg
ADDED
|
docs/images/look_flat.jpg
ADDED
|
docs/images/look_this_icon.jpg
ADDED
|
|
docs/images/lost_dog.jpg
ADDED
|
docs/images/love_you.gif
ADDED
|
Git LFS Details
|
docs/images/luoyonghao_say.jpg
ADDED
|
docs/images/luxun_say.jpg
ADDED
|
docs/images/maikease.gif
ADDED
|
Git LFS Details
|
docs/images/maimai_awaken.jpg
ADDED
|
docs/images/maimai_join.jpg
ADDED
|
docs/images/make_friend.jpg
ADDED
|
docs/images/marriage.jpg
ADDED
|
docs/images/meteor.jpg
ADDED
|
docs/images/mihoyo.png
ADDED
|
Git LFS Details
|
docs/images/mourning.jpg
ADDED
|
docs/images/mourning_instance0.jpg
ADDED
|
docs/images/mourning_instance1.jpg
ADDED
|
docs/images/murmur.jpg
ADDED
|
docs/images/my_friend.jpg
ADDED
|
docs/images/my_wife.jpg
ADDED
|
docs/images/name_generator.jpg
ADDED
|
docs/images/need.jpg
ADDED
|
docs/images/nekoha_holdsign.jpg
ADDED
|
docs/images/nihaosaoa.gif
ADDED
|
Git LFS Details
|
docs/images/nijika_holdsign.jpg
ADDED
|
docs/images/no_response.jpg
ADDED
|
docs/images/nokia.jpg
ADDED
|
docs/images/not_call_me.png
ADDED
|
Git LFS Details
|
docs/images/note_for_leave.jpg
ADDED
|
docs/images/oshi_no_ko.png
ADDED
|
Git LFS Details
|