Coder Social home page Coder Social logo

prompt-engineer's Introduction

PROMPT ENGINEER

Inspired by Prompt Battle.

A picture is worth more than a thousand words… see for yourself. This is the view that is meant for the audience:

Installation

  1. Create a venv and activate it
    $ python -m venv venv
    $ source venv/bin/activate
    
  2. Install the requirements from the requirements file
    $ pip install -r requirements.txt
    
  3. Copy the file example_config.ini to config.ini
  4. Adapt the values within the file config.ini

Run the app

  1. Identify your local IP address from which the app should be accessible. In the following example, this IP will be 192.168.0.20.
  2. Start the web server
    $ cd web
    $ python3 -m http.server -b 192.168.0.20 3000
    
  3. Install the app Phyphox on your smartphone.
  4. Start the Experiment Applause meter (Applausmeter in German) within Phyphox and enable Allow remote access (Fernzugriff erlauben in German) in the menu (three-dot menu on Android).
  5. Start the websocket server part. The first argument is the listening IP for the server, and the second argument is the IP of your smartphone (Phyphox shows the IP at the bottom of the screen):
    $ python3 server.py 192.168.0.20 192.168.0.42
    
  6. Start playing by visiting http://192.168.0.20:3000 in a browser.

Playing

The following four pages are available:

  1. /page.html?player=PlayerX - For the first player
  2. /page.html?player=PlayerY - For the second player
  3. /controller.html - For the game master
  4. /summary.html - For the audience
  5. /slideshow.html - Useful to show the pictures after the game has finished

Note: In the browser, use the IP address identified in the first step of Run the app and do not use localhost or 127.0.0.1.

Preparing your show

Here are some steps you need to consider when setting up your game show.

  1. Prepare a set of tasks for the player and add them to the collection in web/controller.html.
  2. Obtain your OpenAI key and enter it in the config.ini file. Do not forget to set production = true.
  3. Optimally, provide each player with their own device to enter the prompt.
  4. Generated images are stored under web/images. The prompt used to generate each image can be retrieved with exiftool [image].

Development

The set of tools used for development, code formatting, style checking, and testing can be installed with the following command:

python3 -m pip install -r requirements-dev.txt

All tools can be executed manually with the following commands and report errors if encountered:

black .
flake8

A black and flake8 check of modified files before any commit can also be forced using Git's pre-commit hook functionality:

pre-commit install

More information on the black and flake8 setup can be found at https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/

Contributions

Thanks to KonWol for testing, testing, adding features and discussing the game during its development. Due to a fresh Git history, his additions prior to the cut are not attributed to him.

prompt-engineer's People

Contributors

he-ro avatar

Stargazers

fachsimpeln avatar

Watchers

 avatar

Forkers

konwol

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.