{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import tensorflow as tf\n", "import gpt_2_simple as gpt2\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "WARNING:tensorflow:From D:\\Program files\\Anconda Python\\lib\\site-packages\\tensorflow\\python\\framework\\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n", "Instructions for updating:\n", "Colocations handled automatically by placer.\n", "Loading checkpoint checkpoint\\run1\\model-1000\n", "WARNING:tensorflow:From D:\\Program files\\Anconda Python\\lib\\site-packages\\tensorflow\\python\\training\\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n", "Instructions for updating:\n", "Use standard file APIs to check for files with this prefix.\n", "INFO:tensorflow:Restoring parameters from checkpoint\\run1\\model-1000\n" ] } ], "source": [ "sess = gpt2.start_tf_sess()\n", "gpt2.load_gpt2(sess, run_name='run1')" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\tIn her prime, Kim Jojoé deopsyed into the history of Japan, a visit to her cousin's funeral, and a weekend famous chef's sister's wedding.\t\n", "====================\n", "\u000fCarefully guiding hardware salesman Miles Neufeld into the wilderness, this next Oscar-winning his his �70s horror story centers on an ex-movie buff and his personal crisis.\t\n", "====================\n", "\tNatural disasters like the one in Dallas, Texas, spell disaster for newlychristianated Donald Trump Towers.Six individuals choose between the two jobs outlined in this mega-donation order and become the Trump Organization.\t\n", "====================\n", "\tWhen lead singer of a suburban garage rock band comes home prior to a scheduled performance, his estranged father begins shunning the fun stops they allow.\t\n", "====================\n", "\tAn action-packed morning in the Hunter Valley is for dreamingers only. They awaken to a world filled with smoke and horror. Cue scenes of misery, joy and a dash of luck.\t\n", "====================\n", "\tA playful, imaginative 14-year-old Chinese girl endured censures during her high school interview course while navigating her reasons for rejecting love.\t\n", "====================\n", "\u000eA deputy cruise guard in Kasika, India, is forced to adhere to a woman's strict computerized opinions when she falls for his girlfriend's boy scout husband.\t\n", "====================\n", "\tNew Orleans designer Aram Jesorkis Sharp takes custom-built homes and custom buildings at Big Easy and Inside L Hayes for 99% of the price.\t\n", "====================\n", "\t'd Yards – a sled team that trains with soothe pain and toughness that it inspires confidence in their abilities. –\n", "\n", "====================\n", "\tGermany's Fikret leaves off the World Cup Final and takes on mission Islamic State in a retelling of mujahideen dispatches from SITEK's office.\t\n", "====================\n", "Comedians Steve Coogan and Katherine Ryan usually don suits and don't give a rat's ass about their overabundance of weird'ery. Not anymore. – they're officially reality stars.\t\n", "====================\n", "\tThis sophisticated dance studio renovation project recalls the looks of the hut’s legendary home, with a special focus on those seeking its unconventional use of energy.\t\n", "====================\n", "\tThree host families with cat-like creatures contend with personal challenges and family tensions in a moving, emotional documentary owned by requirements.\t\n", "====================\n", "\tLos Angeles police officers race across America to catch the elusive Uber troll, trying to more quickly solve a human trafficking case and uncover his secret identity.\t\n", "====================\n", "\tBrazilian comedian Onur meets fascinating guests at both his company and his home based on his stand-up show Bridge of Evil.\t\n", "====================\n", "\tDuring a holiday stay at a hotel resort, a flight attendant receives first hand accounts of an unusual manhunt for a group of young women at the Pearl Harbor Campground.\t\n", "====================\n", "\tLas Pianoón gets a dance in Barcelona after asking her punk friend to put on a show, but the only way to ruin it is if he lets her handle the booze.\t\n", "====================\n", "\tRadically changed by a misunderstanding 10 years ago, a biotech expert is now preparing a vaccine against gladiator-turned-velfer Galavant Ixen.\t\n", "====================\n", "\tThe security chief at a Shanghai soup kitchen impregnates his ruthless boss's huge, stinking nemesis, while detective Ji Shiei and moon monkey Jiajian strive to crack the case.\t\n", "====================\n", "\tWhen a special task force goes undercover as a secret foreign agent, they join forces to protect the world from evil.\t\n", "====================\n" ] } ], "source": [ "gpt2.generate(sess,\n", " length=120,\n", " temperature=1.4,\n", " prefix=\"<|startoftext|>\",\n", " truncate=\"<|endoftext|>\",\n", " nsamples=20,\n", " batch_size=10,\n", " include_prefix=False\n", " )" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.0" } }, "nbformat": 4, "nbformat_minor": 4 }