From 2ab414f26dadf735d9ce671f68d1ed0005d0ba15 Mon Sep 17 00:00:00 2001 From: Nick Walton Date: Fri, 6 Dec 2019 08:10:29 -0700 Subject: [PATCH] Add files via upload --- AIDungeon_2.ipynb | 198 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 AIDungeon_2.ipynb diff --git a/AIDungeon_2.ipynb b/AIDungeon_2.ipynb new file mode 100644 index 0000000..5c5272d --- /dev/null +++ b/AIDungeon_2.ipynb @@ -0,0 +1,198 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Copy of AIDungeon 2.ipynb", + "provenance": [], + "toc_visible": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "7dRi_BDWErNf", + "colab_type": "text" + }, + "source": [ + "# AI Dungeon 2\n", + "AI Dungeon 2 is a completely AI generated text adventure built with OpenAI's largest GPT-2 model. It's a first of it's kind game that allows you to enter and will react to any action you can imagine.\n", + "\n", + "## How to play\n", + "1. Click \"Open in playground mode\"\n", + "2. Click \"Tools\"-> \"Settings...\" -> \"Theme\" -> \"Dark\" (optional but recommended)\n", + "3. Click \"Runtime\" -> \"Run all\"\n", + "\n", + "##Links:\n", + "* Read stories from AIDungeon2 at [aidungeon.io](https://www.aidungeon.io)\n", + "* Read more about how AIDungeon2 was made [here](https://pcc.cs.byu.edu/2019/11/21/ai-dungeon-2-creating-infinitely-generated-text-adventures-with-deep-learning-language-models/)\n", + "* If you like playing then please consider [supporting](https://www.patreon.com/join/AIDungeon/) me to allow future improvements to AI Dungeon. \n", + "\n" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "FKqlSCrpS9dH", + "colab_type": "code", + "outputId": "ec4f9bd8-79c3-4548-c96b-61bb70530a7d", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + } + }, + "source": [ + "!git clone https://github.com/nickwalton/AIDungeon/ \n", + "%cd AIDungeon\n", + "!./install.sh\n", + "from IPython.display import clear_output\n", + "clear_output()\n", + "print(\"Download Complete!\")" + ], + "execution_count": 0, + "outputs": [ + { + "output_type": "stream", + "text": [ + "Download Complete!\n" + ], + "name": "stdout" + } + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "YjArwbWh6XwN", + "colab_type": "code", + "outputId": "b14b924f-4b0d-462d-9545-e47477d7f729", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1185 + } + }, + "source": [ + "%cd AIDungeon\n", + "from IPython.display import Javascript\n", + "display(Javascript('''google.colab.output.setIframeHeight(0, true, {maxHeight: 10000})'''))\n", + "!python play.py\n" + ], + "execution_count": 0, + "outputs": [ + { + "output_type": "stream", + "text": [ + "[Errno 2] No such file or directory: 'AIDungeon'\n", + "/content/AIDungeon/AIDungeon\n", + "Already up to date.\n" + ], + "name": "stdout" + }, + { + "output_type": "display_data", + "data": { + "application/javascript": [ + "google.colab.output.setIframeHeight(0, true, {maxHeight: 10000})" + ], + "text/plain": [ + "" + ] + }, + "metadata": { + "tags": [] + } + }, + { + "output_type": "stream", + "text": [ + "AI Dungeon 2 will save and use your actions and game to continually improve AI\n", + " Dungeon. If you would like to disable this enter 'nosaving' for any action.\n", + " This will also turn off the ability to save games.\n", + "\n", + "Initializing AI Dungeon! (This might take a few minutes)\n", + "\n", + "\n", + "\n", + "\n", + " ▄▄▄ ██▓ ▓█████▄ █ ██ ███▄ █ ▄████ ▓█████ ▒█████ ███▄ █ \n", + "▒████▄ ▓██▒ ▒██▀ ██▌ ██ ▓██▒ ██ ▀█ █ ██▒ ▀█▒▓█ ▀ ▒██▒ ██▒ ██ ▀█ █ \n", + "▒██ ▀█▄ ▒██▒ ░██ █▌▓██ ▒██░▓██ ▀█ ██▒▒██░▄▄▄░▒███ ▒██░ ██▒▓██ ▀█ ██▒ \n", + "░██▄▄▄▄██ ░██░ ░▓█▄ ▌▓▓█ ░██░▓██▒ ▐▌██▒░▓█ ██▓▒▓█ ▄ ▒██ ██░▓██▒ ▐▌██▒ \n", + " ▓█ ▓██▒░██░ ░▒████▓ ▒▒█████▓ ▒██░ ▓██░░▒▓███▀▒░▒████▒░ ████▓▒░▒██░ ▓██░ \n", + " ▒▒ ▓▒█░░▓ ▒▒▓ ▒ ░▒▓▒ ▒ ▒ ░ ▒░ ▒ ▒ ░▒ ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▒░ ▒ ▒ \n", + " ▒ ▒▒ ░ ▒ ░ ░ ▒ ▒ ░░▒░ ░ ░ ░ ░░ ░ ▒░ ░ ░ ░ ░ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░ \n", + " ░ ▒ ▒ ░ ░ ░ ░ ░░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ \n", + " ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ \n", + " ░ \n", + "\n", + "\n", + "\n", + "\n", + "Pick a setting.\n", + "0) fantasy (recommended)\n", + "1) mystery (experimental)\n", + "2) apocalyptic (experimental)\n", + "3) zombies (experimental)\n", + "4) custom experimental\n", + "Enter the number of your choice: 0\n", + "\n", + "Pick a character\n", + "0) noble\n", + "1) knight\n", + "2) squire\n", + "3) wizard\n", + "4) ranger\n", + "5) peasant\n", + "6) rogue\n", + "Enter the number of your choice: 0\n", + "\n", + "What is your name? Nick\n", + "\n", + "AI Dungeon 2 Instructions:\n", + " Enter actions starting with a verb ex. \"go to the tavern\" or \"attack the orc.\"\n", + " To speak enter 'say \"(thing you want to say)\"' or just \"(thing you want to say)\"\n", + " \n", + "\n", + "The following commands can be entered for any action: \n", + " \"revert\" Reverts the last action allowing you to pick a different action.\n", + " \"quit\" Quits the game and saves\n", + " \"restart\" Starts a new game and saves your current one\n", + " \"save\" Makes a new save of your game and gives you the save ID\n", + " \"load\" Asks for a save ID and loads the game if the ID is valid\n", + " \"print\" Prints a transcript of your adventure (without extra newline formatting)\n", + " \"help\" Prints these instructions again\n", + "\n", + "Generating story...\n", + "\n", + "\n", + "You are Nick, a noble living in the kingdom of Larion. You have a pouch of gold\n", + " and a small dagger. You are awakened by one of your servants who tells you that\n", + " your keep is under attack. You look out the window and see an army of orcs marching\n", + " towards your door\n", + "> " + ], + "name": "stdout" + } + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "U1bcLc97srRq", + "colab_type": "code", + "colab": {} + }, + "source": [ + "" + ], + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file