Support dall-e-3 and Update workflows

This commit is contained in:
hibobmaster 2024-04-24 16:48:23 +08:00
parent 69ce5b43a3
commit 9288f9aef8
No known key found for this signature in database
3 changed files with 83 additions and 9 deletions

73
.github/workflows/docker-debug.yml vendored Normal file
View File

@ -0,0 +1,73 @@
name: Publish Docker image
on:
push:
branches:
- 'main'
paths:
- '**.py'
jobs:
push_to_registry:
name: Push Docker image to registry
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: hibobmaster/matrixchatgptbot
tags: |
type=sha,format=long
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image(dockerhub)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Docker metadata(ghcr)
id: meta2
uses: docker/metadata-action@v5
with:
images: ghcr.io/hibobmaster/matrixchatgptbot
tags: |
type=sha,format=long
- name: Build and push Docker image(ghcr)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta2.outputs.tags }}
labels: ${{ steps.meta2.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@ -14,13 +14,13 @@ jobs:
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@ -28,7 +28,7 @@ jobs:
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: hibobmaster/matrixchatgptbot
tags: |
@ -36,13 +36,13 @@ jobs:
type=ref,event=tag
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image(dockerhub)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
@ -54,7 +54,7 @@ jobs:
- name: Docker metadata(ghcr)
id: meta2
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/hibobmaster/matrixchatgptbot
tags: |
@ -63,7 +63,7 @@ jobs:
type=sha,format=long
- name: Build and push Docker image(ghcr)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64

View File

@ -24,8 +24,9 @@ async def get_images(
},
json={
"prompt": prompt,
"model": "dall-e-3",
"n": kwargs.get("n", 1),
"size": kwargs.get("size", "512x512"),
"size": kwargs.get("size", "1024x1024"),
"response_format": "b64_json",
},
timeout=timeout,