karafra / ai-art Goto Github PK
View Code? Open in Web Editor NEWDiscord bot generating images from given query
Home Page: https://karafra.github.io/ai-art/
License: Apache License 2.0
Discord bot generating images from given query
Home Page: https://karafra.github.io/ai-art/
License: Apache License 2.0
deploy-discord-chat-bot-1 | [Nest] 31 - 01/18/2023, 3:42:14 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (3)...
deploy-discord-chat-bot-1 | MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
on step
docker-compose -f "docker/deploy/docker-compose.yml" up
any ideas?
I just redeployed the bot with the latest commits and got this error immediately after. How do I remediate this?
2022-08-26T05:19:52.089809+00:00 app[worker.1]: MongoError: Collection already exists. NS: test.Job 2022-08-26T05:19:52.089810+00:00 app[worker.1]: at MessageStream.messageHandler (/app/node_modules/mongodb/lib/cmap/connection.js:299:20) 2022-08-26T05:19:52.089810+00:00 app[worker.1]: at MessageStream.emit (node:events:513:28) 2022-08-26T05:19:52.089810+00:00 app[worker.1]: at MessageStream.emit (node:domain:489:12) 2022-08-26T05:19:52.089811+00:00 app[worker.1]: at processIncomingData (/app/node_modules/mongodb/lib/cmap/message_stream.js:144:12) 2022-08-26T05:19:52.089811+00:00 app[worker.1]: at MessageStream._write (/app/node_modules/mongodb/lib/cmap/message_stream.js:42:5) 2022-08-26T05:19:52.089811+00:00 app[worker.1]: at writeOrBuffer (node:internal/streams/writable:391:12) 2022-08-26T05:19:52.089811+00:00 app[worker.1]: at _write (node:internal/streams/writable:332:10) 2022-08-26T05:19:52.089812+00:00 app[worker.1]: at MessageStream.Writable.write (node:internal/streams/writable:336:10) 2022-08-26T05:19:52.089812+00:00 app[worker.1]: at TLSSocket.ondata (node:internal/streams/readable:754:22) 2022-08-26T05:19:52.089812+00:00 app[worker.1]: at TLSSocket.emit (node:events:513:28) 2022-08-26T05:19:52.089813+00:00 app[worker.1]: at TLSSocket.emit (node:domain:489:12) 2022-08-26T05:19:52.089813+00:00 app[worker.1]: at addChunk (node:internal/streams/readable:315:12) 2022-08-26T05:19:52.089813+00:00 app[worker.1]: at readableAddChunk (node:internal/streams/readable:289:9) 2022-08-26T05:19:52.089813+00:00 app[worker.1]: at TLSSocket.Readable.push (node:internal/streams/readable:228:10) 2022-08-26T05:19:52.089814+00:00 app[worker.1]: at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) 2022-08-26T05:19:55.404560+00:00 app[worker.1]: �[32m[Nest] 22 - �[39m08/26/2022, 5:19:55 AM �[32m LOG�[39m �[38;5;3m[createCappedJobsCollection1661353047612] �[39m�[32mRunning migration Create capped Jobs collection 1661353047612�[39m 2022-08-26T05:19:55.404785+00:00 app[worker.1]: �[95m[Nest] 22 - �[39m08/26/2022, 5:19:55 AM �[95m DEBUG�[39m �[38;5;3m[createCappedJobsCollection1661353047612] �[39m�[95mCreating capped collection "Jobs" with size 400000000B�[39m 2022-08-26T05:19:55.440021+00:00 app[worker.1]: Migration "Create capped Jobs collection 1661353047612" failed, error: Collection already exists. NS: test.Job 2022-08-26T05:19:55.441449+00:00 app[worker.1]: �[31m[Nest] 22 - �[39m08/26/2022, 5:19:55 AM �[31m ERROR�[39m �[38;5;3m[TypeOrmModule] �[39m�[31mUnable to connect to the database. Retrying (2)...�[39m
Could you possibly add either DALLE 2, synth.run, or CLIP?
I successfully deployed the app using docker-compose -f "docker/deploy/docker-compose.yml" up -d
.
In my .env
, I have added OPEN_API_TOKEN = '[redacted]'
which contains a valid API key from Open AI.
However, the command to run /ai-story story
doesn't show up.
If I use /ai-story open-ai Give me a poem
instead, I get the following error in my logs.
2023-01-24 16:52:06 [Nest] 32 - 01/24/2023, 5:52:06 AM DEBUG [OpenAiCommand] /ai-story open-ai command called
2023-01-24 16:52:07 [Nest] 32 - 01/24/2023, 5:52:07 AM DEBUG [AiStoryService] Generating Give me a poem in style text-davinci-002
2023-01-24 16:52:07 [Nest] 32 - 01/24/2023, 5:52:07 AM ERROR [OpenAiCommand] Open-ai command failed with exception: Could not generate art "Give me a poem" based on AiStoryService in style "text-davinci-002"
The only command that reliably works is /ai-art wombo-dream
.
I know it's paid (like openAI story anyway) but it would be nice to integrate the stable diffusion API
https://github.com/Stability-AI/stability-sdk
Apparently, you can run this model locally for free too
https://github.com/CompVis/stable-diffusion
https://www.howtogeek.com/830179/how-to-run-stable-diffusion-on-your-pc-to-generate-ai-images/
it's been down for quite a bit and i wonder if it will ever come back
Have the bot deployed via Docker.
OpenAI key is valid and functioning tested by sending a request to https://api.openai.com/v1/models with my API key in the header and it did return the list of available models so that seems to be working fine.
I did slap the tokens into the docker-compose file but that hasn't been an issue for me for the required bot tokens.
Tried with and without quotation marks for the OpenAI token.
args:
- DISCORD_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- DISCORD_BOTID=111111111111111111
- OPEN_AI_TOKEN=xx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
When sending the story request I get the following error in Discord:
Could not process prompt due to internal error (Request failed with status code 401)
Of course, the Docker log also reports:
2022-07-14 06:45:05 : Generating story with headline a storm is brewing based on text-davinci-002 model
2022-07-14 06:45:06 : Request failed with status code 401
I successfully deployed the app using docker-compose -f "docker/deploy/docker-compose.yml" up -d
.
But when I interact with the bot with /ai-story story
, it crashes and I see the following error in the logs.
2023-01-24 16:05:09 This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
2023-01-24 16:05:09 TypeError: Cannot destructure property 'dtoInstance' of 'commandNode' as it is undefined.
2023-01-24 16:05:09 at CommandExplorer.<anonymous> (/usr/src/app/node_modules/@discord-nestjs/core/src/explorers/command/command.explorer.ts:90:17)
2023-01-24 16:05:09 at Generator.next (<anonymous>)
2023-01-24 16:05:09 at /usr/src/app/node_modules/@discord-nestjs/core/dist/explorers/command/command.explorer.js:17:71
2023-01-24 16:05:09 at new Promise (<anonymous>)
2023-01-24 16:05:09 at __awaiter (/usr/src/app/node_modules/@discord-nestjs/core/dist/explorers/command/command.explorer.js:13:12)
2023-01-24 16:05:09 at Client.<anonymous> (/usr/src/app/node_modules/@discord-nestjs/core/src/explorers/command/command.explorer.ts:67:76)
2023-01-24 16:05:09 at Client.emit (node:events:525:35)
2023-01-24 16:05:09 at Client.emit (node:domain:489:12)
2023-01-24 16:05:09 at InteractionCreateAction.handle (/usr/src/app/node_modules/discord.js/src/client/actions/InteractionCreate.js:83:12)
2023-01-24 16:05:09 at Object.module.exports [as INTERACTION_CREATE] (/usr/src/app/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
2023-01-24 16:05:09 at WebSocketManager.handlePacket (/usr/src/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:346:31)
2023-01-24 16:05:09 at WebSocketShard.onPacket (/usr/src/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:478:22)
2023-01-24 16:05:09 at WebSocketShard.onMessage (/usr/src/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:317:10)
2023-01-24 16:05:09 at WebSocket.onMessage (/usr/src/app/node_modules/ws/lib/event-target.js:199:18)
2023-01-24 16:05:09 at WebSocket.emit (node:events:513:28)
2023-01-24 16:05:09 at WebSocket.emit (node:domain:489:12)
Create tsconfig.doc.json file in the repo root
build:docs
command to this fileAdd support for commands section in documentation
Create markdown file with static command documentation (possible update to dynamic annotation based generator later)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.