palpen / dalleepaperframe Goto Github PK
View Code? Open in Web Editor NEWThis project forked from famousdirector/dalleepaperframe
License: MIT License
This project forked from famousdirector/dalleepaperframe
License: MIT License
Currently, prompts_config.yml
is hardcoded in the client.py
module. Making it an input instead will allow for different prompt configuration across different displays (e.g. some display can have a children illustration theme whereas others could be Van Gogh oil paintings)
I'd like to give clients outside of my network ability to make a requests to the my local server that's hosting DALL-E.
The client checks the saved_images
folder for text prompts for which images have already been generated. If there happens to be a Tweet prompt for which no images has been generated by the client and the server also happens to be off, the client will keep sending a request to the server for a new image and fail. Eventually, the counter for the number of screen refreshes reaches its max limit and the client's program is shut off.
This is a bug. We want the client to load images from the saved_images
folder when the server is off (if there are no images, then the program should exit) even if there are new Tweet prompts.
Solution:
saved_images
Implementation:
check_recent_tweets_and_generate_image_if_new
?) before making a request to Twitter APIAt present, each client is checking Twitter for a text prompt using the same hashtag. A new tweet with the trigger hashtag (currently, #dalle) will update the image in all client displays. This issue will make the changes that will assign a unique trigger hashtag to each client so that they can be controlled from Twitter independently (but also includes the option to change them all simultaneously).
Implementation:
tweets_utils.py
to the config yaml filesretrieve_tweets_containing_text_prompt
function in tweets_utils.py
to include an argument for each trigger hashtagprompts_config.yml
lives [here](https://github.com/palpen/DALLEePaperFrame/blob/main/client/prompts_config.yml.
For the official prompt engineering guide, see the DALL-E prompt book here
Code for how to do this
import logging
from logging.handlers import RotatingFileHandler
LOG_LEVEL = logging.INFO
logging.basicConfig(
handlers=[RotatingFileHandler('client.log', maxBytes=100000, backupCount=10)],
level=LOG_LEVEL,
format="[%(asctime)s] %(levelname)s [%(filename)s.%(module)s.%(funcName)s:%(lineno)d] %(message)s",
datefmt='%Y-%m-%dT%H:%M:%S'
)
logger = logging.getLogger('client_logger')
# Testing
def foo():
logger.info("Log in function")
return None
for i in range(1000):
foo()
logger.info(f"This is an info {i}")
logger.debug('Hello, world!')
Relevant files:
client.py
tweets_utils.py
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.