diff --git a/survey_create_input.py b/survey_create_input.py new file mode 100644 index 00000000..b20a923c --- /dev/null +++ b/survey_create_input.py @@ -0,0 +1,24 @@ +#-H "accept: application/json" -H "Content-Type: application/json" -d '{"prompt": "Niko the kobold stalked carefully down the alley, his small scaly figure obscured by a dusky cloak that fluttered lightly in the cold winter breeze. Holding up his tail to keep it from dragging in the dirty snow that covered the cobblestone, he waited patiently for the butcher to turn his attention from his stall so that he could pilfer his next meal: a tender-looking chicken. He crouched just slightly as he neared the stall to ensure that no one was watching, not that anyone would be dumb enough to hassle a small kobold. What else was there for a lowly kobold to do in a city? All that Niko needed to know was where to find the chicken and then how to make off with it. A soft thud caused Niko to quickly lift his head. Standing behind the stall where the butcher had been cutting his chicken,", "temperature": 0.5, "top_p": 0.9}'} + +import requests, tqdm, json +prompt = "Niko the kobold stalked carefully down the alley, his small scaly figure obscured by a dusky cloak that fluttered lightly in the cold winter breeze. Holding up his tail to keep it from dragging in the dirty snow that covered the cobblestone, he waited patiently for the butcher to turn his attention from his stall so that he could pilfer his next meal: a tender-looking chicken. He crouched just slightly as he neared the stall to ensure that no one was watching, not that anyone would be dumb enough to hassle a small kobold. What else was there for a lowly kobold to do in a city? All that Niko needed to know was where to find the chicken and then how to make off with it. A soft thud caused Niko to quickly lift his head. Standing behind the stall where the butcher had been cutting his chicken," +url = "http://localhost:5000/api/v1/generate" + +results = {"temp": {}, "top_k": {}, "rep_pen": {}} +for temp_tenths in tqdm.tqdm(range(1, 21)): + temp = float(temp_tenths)/10.0 + x = requests.post(url, json = {"prompt": prompt, "temperature": temp}, headers = {"Content-Type": "application/json", "accept": "application/json"}) + results["temp"][temp] = [item['text'] for item in x.json()['results']] + +for temp_tenths in tqdm.tqdm(range(50, 101, 5)): + temp = float(temp_tenths)/100.0 + x = requests.post(url, json = {"prompt": prompt, "top_k": temp}, headers = {"Content-Type": "application/json", "accept": "application/json"}) + results["top_k"][temp] = [item['text'] for item in x.json()['results']] + +for temp_tenths in tqdm.tqdm(range(100, 131, 5)): + temp = float(temp_tenths)/100.0 + x = requests.post(url, json = {"prompt": prompt, "rep_pen": temp}, headers = {"Content-Type": "application/json", "accept": "application/json"}) + results["rep_pen"][temp] = [item['text'] for item in x.json()['results']] + +with open("output.json", "w") as f: + f.write(json.dumps(results, indent="\t")) \ No newline at end of file diff --git a/survey_input.json b/survey_input.json new file mode 100644 index 00000000..7b102eeb --- /dev/null +++ b/survey_input.json @@ -0,0 +1,198 @@ +{ + "temp": { + "0.1": [ + " a large man with a long beard and a black coat stood staring at him.\n\n\"You're a little late, aren't you?\" The man's voice was deep and rich, and it carried a hint of menace.\n\nNiko", + " a man was leaning against the wall, his back to Niko. The man's face was hidden by a hood, but Niko could see the glint of a knife in his hand.\n\n\"You're late,\" said the man,", + " was an old man with a long white beard and a pair of large black eyes.\n\n\"You're Niko,\" said the old man, his voice deep and resonant. \"I'm Gorgon.\"\n\n\"Gorgon" + ], + "0.2": [ + " was an old man with a long white beard and a pair of sharpened wooden stakes in his hands.\n\n\"I am looking for a chicken,\" Niko said, his voice a low rumble.\n\nThe old man looked at Nik", + " was an old man with a long white beard. The old man was dressed in a black robe and a pair of silver sandals. He was holding a large knife in his hand and was looking at Niko with a smile on his face.\n", + " a man was leaning against the wall, his back to Niko. The butcher's eyes were locked on the man, and Niko knew that the man was looking at him.\n\n\"Hey,\" said Niko, \"you want to buy" + ], + "0.3": [ + " was an old man who looked to be about his age. The old man's eyes were red and puffy and he was wearing a filthy leather jerkin. He was also holding a large knife in his right hand.\n\n\"You're late", + " a man in a black hooded robe was staring at him.\n\n\"What do you want?\" Niko asked.\n\nThe man in the hooded robe looked up at Niko, his eyes narrowed. \"I am looking for someone", + " a man stood on the other side of the alley.\n\n\"What are you doing here?\" asked the man.\n\n\"I'm looking for a chicken,\" said Niko.\n\n\"You'll have to wait until the meat is" + ], + "0.4": [ + " he watched as a large man stepped out of the shadows and approached the stall. The butcher stopped his work and turned to face the stranger.\n\n\"What are you doing here?\" Niko asked, his voice low and menacing.\n\n\"", + " he saw a tall man in a black coat and hood stride purposefully toward him.\n\n\"What are you doing here?\" asked Niko.\n\nThe stranger's voice was deep and smooth. \"I am looking for my friend.\"\n\n", + " stood a tall man with black hair and a dark beard. The man's eyes were dark and piercing, the kind of eyes that could easily penetrate the thickest hide of any animal in the world.\n\n\"You're a kobold now" + ], + "0.5": [ + " a young man with brown hair and a narrow face stood gazing at him with a smile that said, \"I'm sorry.\"\n\n\"Oh, don't be sorry,\" Niko replied. \"It's just that you look like you could use", + " stood an elderly man in a long black coat and a hat. The man looked up and saw Niko. He smiled and said, \"Hello my friend.\"\n\n\"Hello,\" Niko replied.\n\n\"You must be hungry,\" the", + " he snatched a knife from the table and strode over to the stall.\n\n\"What is it?\" asked an angry voice from the shadows.\n\nNiko turned to see who had spoken. The young man was standing in the corner of" + ], + "0.6": [ + " a man stood with a sad look on his face.\n\n\"You are not selling this chicken?\" the butcher asked.\n\n\"No, I am looking for a young girl.\"\n\n\"Young?", + " two men were arguing. The butcher was making a point about not cutting the chicken open or giving the meat to an animal that had already been slaughtered.\n\n\"Or you could just take the money and go,\" said one of the men. \"", + " he watched quietly as the unfortunate creature slowly fell to the ground.\n\nA new voice called his name.\n\nNiko looked up to see who had spoken.\n\n\"Hey, what's going on?\" asked the boy as he approached" + ], + "0.7": [ + " a young girl sat on a stool nearby. He noticed that she was watching him closely, her eyes widening when she saw him.\n\nShe looked at him curiously, her face twisted in a way that indicated she was thinking of what he was doing", + " a boy was hunkered down on the ground, the meat of his throat exposed. Niko's eyes widened when he realized who it was.\n\n\"Papa!\" The child jumped to his feet, his eyes wide at the sight of the", + " was none other than Lord Vierna with her little pet!\n\n\"What are you doing here?\" Niko growled.\n\n\"I am looking for the chicken,\" she said calmly.\n\n\"Oh, well, then," + ], + "0.8": [ + " stood two men. One was tall and lean, his hair perfectly clipped and his hands neatly manicured. The other was shorter and stockier, his hair slicked back with salt and pepper, his face clean shaven. Both wore the garish", + " he reached out slowly and touched the cloven hoof of the chicken, which was still visible underneath a thick layer of blood. Without hesitation, Niko yanked the carcass back into the stall and then rose to his feet. The next moment", + " sat an enormous deformed man holding a child who looked like an oversized baby doll. In his large hands was a child that was dangerously close to passing out. The man turned his attention to the boy, who was still unconscious.\n\n\"" + ], + "0.9": [ + " there was no sign of the body lying inside. That meant that this bird must have been purchased from some other trader before being stoned and killed. A sight Niko would like to share with Nao as well as any customer who might happen along", + " a huge cat peeked out from behind the massive wooden barrel which served as his home.\n\nThe sound of hooves on the cobblestones brought the conversation to a halt. \"Is there trouble, Bihari?\" asked a voice from", + " stood an older man with a dull, red beard and a long, pale coat hanging loosely over his shoulders.\n\n\"Good morning, lads,\" the kobold said as he leaned against the wooden stall wall. \"You want to give" + ], + "1.0": [ + " was Kiro the merchant. The man clearly regarded Niko as an inconvenience, but he was wrong. Kiro had provided Niko with a way to feed his family, since Niko was hoping that this establishment would be his next stop.\n", + " Niko was nearly on top of him, his tail now held out straight ahead at shoulder height. Niko's claws dug into the little man's chest as he scratched at the bleeding wound, hoping desperately that something might break loose from the beggar", + " the heat exchanger must have given out on a gust of air coming through the crack. Though the foul air was thinning, the temperature was still plunging. Another draft danced over the meat hanging from the meat hook. With a growl," + ], + "1.1": [ + " another haughty man spied the kobold, but didn't yet notice him because of the snow.\n\n\"The Kasbah is a war zone, captain, and no one should be allowed within the walls without special permission.\" Without", + " Niko watched in absolute awe as Captain Hippocrates nimbly pried off an eye of soured chicken from a crate. Quick as light, Niko leapt down from his own stall and landed before his food could come into danger. Having broken", + " Niko craned his neck towards the sound of the falling snow. He listened hard, trying to hear if anyone was coming around the corner into view. He looked round cautiously, holding his ears back because of the freezing wind. From the bright light" + ], + "1.2": [ + " but far enough away to prevent him from being recognized, was a lonely trollie, his hands still clutching the same cabbagey bag that was jumbled on his head. For a creature of such strength and size, Niko was incredibly weak and skinny", + " was not Luciana the looker, but something much more intimidating. She was dressed in boots, breeches and an overgarment\u2014a golden colored blazer over dark spats of a green material. Small bunches of coiled silver fibers", + " he pulled out a knife, held it up to his face, and pried back his own bottom lip as his eyes narrowed on something in the man's dress. Blood. Tiny splashes of red against his white teeth.\n\nWith his surprise" + ], + "1.3": [ + " lounging a muscle spinner's red tank top between his hooves, hove at him out of the frozen air. \"If you want your dinner, idiot, you have to come back through me.\" Niko announced loudly", + " he raised his shoulder high and planted a large claw on either side of his skull before saying in a soft whisper, \"Nur\" through his wing feathers, the grammar equivalent of fhirn's mimic growl. The cart standing next to", + " Horatius dropped onto his haunches and moved rapidly towards the poultry pen. He pulled up his hood to cover his grubby golden eyes and prepared to throw himself upon the hawk-beaked giant before turning to face another wooden box of food." + ], + "1.4": [ + " someone was sliding onto the cobbles. A few feet away sat the scarecrow: clean-shaven, clad in denim jeans and pink Converse basketball sneakers, outfitted in only a plaid t-shirt. The scarecrow tossed his blood", + " Niko growled menacingly.\n\n\"What are you staring at?!\" Lifting his large lollipop handle, Izak nodded calmly towards Niko. \"His fate is sealed\u2026or at least he'll", + " Niko was taken aback when the busy street shivered suddenly, releasing the powerful blast of air at his command. In the time it took him to blink, everything had happened fast.\n\nSmoke poured out of both buildings, mixed together into" + ], + "1.5": [ + " no longer burdened by his pathetic ducklike form, but exultant and resolute, sat what appeared to be an enormous dove which regarded the object of Niko's larcenous intent very condescendingly before homing in", + " Niko let out a startled yelp as he noticed another stall laden with beefsteak and vegetables. That one was fairly empty so he tucked his feet underneath himself and lifted his body into a shambling awkward gait. The next week", + " stand fast\u2014take what you need. The enormous sky clouds roared around him, causing Niko to bounce briefly, though only slightly, while signaling that the best course of action was to simply follow through and trust no one. From his precarious perch" + ], + "1.6": [ + " Maushui Hamaki had entered his yard. Clad only in black silken trousers and black jacket, he threw a great bubble of a handkerchief at a poor discarded kobold. He yelped, grabbing for his arm to", + " Krach encircled his body with narrow wings held tight at his sides.\n\nBarely alive, yes, even fighting, but he looked confident in his defiance. Fear hadn't yet worn its course through his steady chin \u2013", + " there was indeed another skulking wooden troll on the sidewalk, frozen solid with horror and terror. Another blossom boy tried to save the chicken, but ended up abandoning it in the snow before doing so. They wouldn't even eat their last animal" + ], + "1.7": [ + " Danir woke up and rubbed sleep from his eyes. With a gentle flick of his claws, the Kobold regurgitated some bits of food and tore it away with his teeth before zipping toward the start of his leisurely nap. Wiping", + " a beautiful teenage girl tossed him her cheeks. He gathered his hind leg underneath his body to receive the tribute before slowly retreating back down the alley. \"Where do you get these wild pet young ladies?\" muttered Mikaya casually. It didn't take her", + " however, the woman had removed the leftmost blade of the sharpened fletchionic fence to slice into her succulent cutlet. She stood next to the half rotted bird, towering above Niko with its toothless upper molars ratt" + ], + "1.8": [ + " Akia crawled around and quickly plucked out the dark skin wrapped around the bird. A vague mist stirred and sat upon the city streets, softly informing that Niko knew that too late even he may never know. When everyone on Westerhorn was already", + " near a litter of four geese who stared sightlessly into the air, lay one osprey. Its hooked beak snapped against the haggard sky like a miniature reed penning plait held back by scales of gray feathers. Had", + " a maroon owl of the little hoi polloi arrived back home this evening. This came as no surprise to any flesh-eater\u2014a pound of potatoes landed onto the path here or anything you were accustomed to. As such, the hair" + ], + "1.9": [ + " another figure nimbly outfitted with more straps on his pack interrupted his chain of thought. \"You like that steak?\" an extremely aggrieved Michonoto slurred through several war stories about Ivan Vankatramaniotza. As the", + " in the dirt beside the rag piled atop its cut face, was Queen Tikikoto (3,194 SLK; 20 PM) perched on her barrel top, listening to rain beating on the raincoat. In an unfathomable stroke of luck", + " a trio of large barnyard animals,including what looked like a coyote dressed in farmer's wear wiggled out of the shadows of a pile of ice crusted stacks. Like hobnailed boots all hirsutely mocc" + ], + "2.0": [ + " Ronker Choenterpi became an obdurate statue as twelve youthful nude assistants swooped down from above and distracted his natural hunting prey. A feat worthy of Atlantis, indeed. The perfect substitute for fighting sea-sharks, weren't they", + " a cloaked person cautiously peeked out through the collar. Could it be just like the wonderful horrible humans said? There was no question of who was approaching, because whoever was guarding the building blocked out the chilly summer afternoon. However, as if summoned by", + " a sight only equaled by Koshtan Zygoku of Sun High\n\"nally homos a splotch sweetak kerinchall chimacked kri veh -A gentleman asks wh t?)serossM killion!Pl" + ] + }, + "top_k": { + "0.5": [ + " on a wooden post, was another little fanged creature.\n\n# Chapter 4: The Double Deceiver\n\nThe human was hard pressed to ignore the anger boiling within him when he was shoved against a fence and a cluster of criminals assembled around", + " was an ancient woman in a black shawl and orange cloak. She wore a cape decorated with silver thread. She walked along the edge of the street, her head set forward, her shoulders stooped, and if she hadn't been carrying some", + " still alive but stunned, was what looked like an old man carrying a basket of fish.\n\n\"I think I see what you're doing,\" said Niko, and slipped inside the shop. One thought suddenly leaped through his mind, sent" + ], + "0.55": [ + " the slender legs of an outstretched baby were poking out of the blood-red rags on its body. The scream this caused was loud enough that any kobold who happened to come upon the bloodied corpse would become a likely target for any", + " what appeared to be two scantily clad young men were chomping down on a bowl of chicken feet and chunks of skin.\n\n\"Ha! I can smell it!\" the lead young man yelled as he laughed maniacally. He opened the", + " on the opposite side of the street, was another well dressed dog that looked nothing like his friends from yesterday. He stood squarely upon his haunches, almost as if he was waiting to be invited in.\n\nThe scent of a caged bird" + ], + "0.6": [ + " a bearded man looked up and gave him a doubtful look. Niko dropped his tail to his side and twisted toward the other stall, but it was too late. The butcher was already at the table, his knife honing its sharpness against the", + " the cute creature with large brown eyes was staring at him with wide open eyes. \"Is there anything you can do for me?\" the large running dog asked.\n\nKilling quietly wasn't an option for Niko. Especially since it might get", + " Thekla wore an odd expression as she approached.\n\n\"Well?\" Niko growled, glancing nervously around as he took in her appearance. His fear turned to curiosity as he watched her matted fur. Not only was her fur" + ], + "0.65": [ + " amid the filthy yellow stool legs that swung back and forth like the necks of beasts, sat someone more dangerous than any thief, yet they were hard to miss.\n\n\"That was quick,\" Tia muttered under her breath. It was hard to", + " the stone image of a gigantic griffin clung to the doorpost. Once again it stared at him intently. Smiling rakishly, Niko peered through the length of the stall, wondering if he should say something about this being", + " Niko observed a small boy of around ten who was crying and trying to coax his mother into a hug.\n\nThe butcher turned around and seemed to mull over his options. 'What's the matter with you?' the frightened little boy asked." + ], + "0.7": [ + " a trio of humanoid heads turned their heads toward Niko. The trio of mouthless mouths spat out the words \"wargrowld\" and the sound of rumbling grinding replaced the voices. Niko backed away quickly, leaving a trace of tracks", + " sat a whole cast of MuckMeat this side of splintered bone. In fact, almost every stranger's face was covered in white and glittering rainbow slime.\n\nNiko growled low and walked past the nearest pair of bystanders,", + " Bruno Malaffi stood guard over a carcass of beastly manhood - a mad buzzard.\n\nAnother hour passed before Niko's efforts at deceit ended in failure. When he finally emerged, his stomach grumbled, and he took" + ], + "0.75": [ + " smiled little Pyshy the butcher, his long thin frame bending over to pluck the carcass from beneath the butcher's matted curls. The rest of the stasis crew quietly slunk out of the dim alley while Pyshy studied the", + " was an unfamiliar curly man who looked positively shock worthy. It was time to get into his line of vision. Not knowing what else to do, Niko stepped into the boy's frame until his little shoulders were close enough to touch. Tapping gently", + " the man was breathing hard.\n\n\"You were good enough to put me in jail, aren't you?\" Niko snarled before stalking toward him. \"Was I not good enough? Does it take an" + ], + "0.8": [ + " stood Lord Snowflake.\n\n\"What's happening?\" said Nyctoge leering at Mrhinni smilingly. \"Don't you know I'm gonna rip your clit off if you don't move?\"\n\n\"Uh", + " an older lady stood watching the exchange with an eager smile plastered across her broken face. Suddenly, a strange man appeared through the back door of the seller's stall and swiftly disappeared into the night. Niko was quick to stop and go over to", + " having herded everyone else to get the chicken, Tira floated before his eyes. A few times in recent years she had walked into the store, pushing her way past the regular customers, who all sneered at her presence, causing Tira to" + ], + "0.85": [ + " standing mere inches away from the part of the shop where he belonged. Just a second or two longer and Niko would have made off with the goods. He opened his mouth to call his little kobold friend to remind him about the order of", + " another voice echoed back at him. \"Run!\" came the urgent cry. Niko grabbed the stall in front of him and dashed forward. Though they were running at such a speed, Niko's body was heavy and his feet did not allow him", + " was an entire pack of feral dogs, a whole nest of them gathered around a nearby refuse truck. They came sniffing through the sodden drift on the sidewalks, their suspicious faces grinning from the brightness of the sun as they raised their massive paws" + ], + "0.9": [ + " a stout young man with hair that glistened like newly fallen snow caught sight of Niko.\n\nA sparkle of recognition appeared in his eye. 'Ah, I thought I recognized you.' The man pushed his hood back and looked up", + " a young man with an equally round puffy, bug-like face attempted to imitate the merchant's awkward stance. But Niko was no fool, and his big, wingspan wrapped around him more tightly than the teenager. Before he could respond,", + " were two tiny figures, dancing awkwardly beside the stall while bowing their heads nervously. \"That's the fourth woman I've seen in these parts,\" said the elderly lady. She ruffled her short grey hair and looked around her shop, tw" + ], + "0.95": [ + " a gaunt man with a hard look in his eyes stepped casually over the ground and out of sight.\n\n\"Well done, my fine noble dog, your worship.\" Niko tried to show his gratitude by yapping happily, but inside he", + " lying against the door of the nearby clothing shop, he was confronted by several furious jerks who stared at him in surprise.\n\n\"What's all this?\" A yell from one of the crazed rats grated past Niko's ears.", + " was an elderly man wearing an embroidered robe and holding a chicken carcass in front of him.\n\n\"Hai! Hai!\" squawked the old man, clapping his hands together loudly in glee.\n\n" + ], + "1.0": [ + " a man was leaning against the wall, his back to Niko. The man's face was hidden by a hood, but Niko could see that he was a young woman.\n\n\"You're late,\" she said, her voice a low", + " a man was leaning against the wall, his back to Niko. The man's face was hidden by a hood, but Niko could see that he was a young man, probably in his early twenties.\n\n\"You're late,\" said", + " a man was leaning against the wall, his back to Niko. The man's face was hidden by a hood, but Niko could see that he was a young man, probably in his early twenties.\n\n\"You're late,\" said" + ] + }, + "rep_pen": { + "1.0": [ + " was one of his slayers, holding a bloody piece of chicken in his gloved hands. \"Hey, boss, you want the carcass?\" Niko asked as he crept slowly toward the stall.\n\nThe butcher glared down at Niko", + " a dark-haired woman came out from the shadows of the back alley. \"Well! It appears you've kept your promise!\" She bowed formally and saluted the kobold's creator with her hand on her hip. \"I am Mrs.", + " the cold wind sent a chill of icy snow swirling around his body and twirling his limbs. Niko's poor, petrified posture froze into a statue before the cold wind sent the cold wind down the street where it picked up other layers of snow" + ], + "1.05": [ + " a boy no older than ten or twelve with dark hair and glasses peered at Niko with a smile. Niko lifted his wing just enough so the child could see him, nodding his head ever so slightly in recognition.\n\n\"Ha-", + " a small group of lowlifes rushed by, giggling and eyeing him. For a moment, he thought he was being set up to fail, but then another small catlike figure with curly yellow fur approached the stall, and then another, until", + " a hulking gargoyle, no less than three stories high, made the oddest sort of thwack. Niko sprang back in surprise, shock-gripped. The kobold's scaly coat flew up into the air and" + ], + "1.1": [ + " a lone Koshikawa ninja stood behind a row of neatly stacked apples and pears.\n\n\"I am the most famous and loved ninja in the world,\" a female voice called from the top of the stairs. \"I do not need to", + " two of the various small girls who worked there turned to stare as the brave little kobold eyed them anxiously from his hiding place. He began whistling a quick tune that would have amused a social studies teacher in elementary school. The girls also", + " was another small animal, even smaller than the kobold.\n\nDabbing cold water from his left hand onto the animals eyes, he saw the creature jump about. In the same moment, a hideous wail of agony caused his ears" + ], + "1.15": [ + " on the other side of the road, a fire burned furiously and the scent of burning meat wafted up toward Niko.\n\nNiko gaped at the sight of the flames. He had never seen a city in flames before. He", + " a blur of yellow hazel eyes fastened on Niko's face.\n\n\"Akrib,\" Niko drawled softly. \"Why are you on the job?\"\n\nAkrib, much like", + " he held out his claws as if he were expecting an unexpected visitor.\n\nThe butcher backed toward the street, giving no opportunity for Niko to steal the chicken before he raised his hand to ruffle Niko's tail. 'Where is the" + ], + "1.2": [ + " was a teenage girl. With her arms folded, she hid her eagerness.\n\nThis wasn't the first time Niko had seen that girl. Sometimes she lingered in her place of employment, despite paying a hefty wage, but none of", + " he watched silently as an elderly man crossed his arms and gazed at the ground. The man studied the floor, muttering under his breath. Finally, the old man leaned forward and sneered, \"I am senor Richard.\"\n\n\"And", + " about twenty paces away, was Sinthia the Knight.\n\nSinthia's hair hung around her face in unkempt disarray, making it difficult for Niko to recognise her as the young girl with a mop of" + ], + "1.25": [ + " a stocky figure stepped forward, an angry glare flashing in his eyes.\n\n\"Are you finished, boy?\" The kobold called to his apprentice.\n\n\"I have everything I need,\" Niko replied.\n\nThe small", + " was an elderly woman holding a butcher knife in her grasp.\n\n\"Fetch my chicken,\" she called to the kobold. \"I want it now!\"\n\n\"Don't take me for a fool, little lamb, if you", + " his long shadow hovered around the carcass. A bird lay in the shadow of the stall.\n\n\n\n\n\n\n\nThe kobold paused, reared up on his hind legs and looked at his quarry with the curiosity born of curiosity." + ], + "1.3": [ + " a skinny old man was loudly shouting at the startled merchant. \"Foul creature!\" The old man's voice echoed around the alleys and streets as everyone bent low to listen to the man's ranting. Finally, a shout went up from the", + " Niko made his way over to the only person he needed to communicate with; Murn, the gluttonous little mercenary.\n\n\"Hey!\" Murn sneered. \"How's your shulchin?", + " a man's silhouette suddenly appeared. Lifting his hands to cover his face, he looked frantically around the alley. He sensed his employer only half-heard the response to his calls.\n\n\"Why you?\" the largeish blond man asked." + ] + } +} \ No newline at end of file diff --git a/survey_run.py b/survey_run.py new file mode 100644 index 00000000..d7dcc466 --- /dev/null +++ b/survey_run.py @@ -0,0 +1,47 @@ +import flask, json, flask_socketio, random, os, sys +app = flask.Flask(__name__, root_path=os.getcwd()) +socketio = flask_socketio.SocketIO(app, async_method="eventlet", manage_session=False, cors_allowed_origins='*', max_http_buffer_size=10_000_000) + +with open("survey_input.json", "r") as f: + data = json.load(f) + +if os.path.exists("survey_results.json"): + with open("survey_results.json", "r") as f: + results = json.load(f) +else: + results = {"Which one feels more random": {}, + "Which one feels more creative": {}, + "Which one feels more repetative": {} + } + +@app.route('/') +def index(): + #choose temp, top_k, or rep_pen + data_type = random.choice(['temp', 'temp', 'temp', 'temp', 'top_k', 'top_k', 'rep_pen']) + a = random.choice([x for x in data[data_type]]) + b = random.choice([x for x in data[data_type]]) + while b == a: + b = random.choice([x for x in data[data_type]]) + + random_num=random.randint(-sys.maxsize, sys.maxsize) + question = {"temp": "Which one feels more random", "top_k": "Which one feels more creative", "rep_pen": "Which one feels more repetative"}[data_type] + if random_num not in results[question]: + results[question][random_num] = {} + results[question][random_num]['A'] = a + results[question][random_num]['B'] = b + + a = data[data_type][a] + b = data[data_type][b] + + return flask.render_template('survey.html', question=question, a=a, b=b, random_num=random_num) + + + +@socketio.on('answer') +def answer(data): + results[data['question']][int(data['id'])]['Answer'] = data['answer'] + with open("survey_results.json", "w") as f: + f.write(json.dumps(results, indent="\t")) + + +socketio.run(app) \ No newline at end of file diff --git a/templates/survey.html b/templates/survey.html new file mode 100644 index 00000000..9bb39544 --- /dev/null +++ b/templates/survey.html @@ -0,0 +1,87 @@ + + + + + + + +
+ Prompt:
+ Niko the kobold stalked carefully down the alley, his small scaly figure obscured by a dusky cloak that fluttered lightly in the cold winter breeze. Holding up his tail to keep it from dragging in the dirty snow that covered the cobblestone, he waited patiently for the butcher to turn his attention from his stall so that he could pilfer his next meal: a tender-looking chicken. He crouched just slightly as he neared the stall to ensure that no one was watching, not that anyone would be dumb enough to hassle a small kobold. What else was there for a lowly kobold to do in a city? All that Niko needed to know was where to find the chicken and then how to make off with it. A soft thud caused Niko to quickly lift his head. Standing behind the stall where the butcher had been cutting his chicken, +
+
+
+

{{ question }}

+
+ + + + + + + + + + + + + + +
+

A

+
+

B

+
+

About the same

+
+

A is incoherent

+
+

B is incoherent

+
+

Both are incoherent

+
+ + {% for item in a %} + + + + {% endfor %} +
+ {{ item }} +
+
+ + {% for item in b %} + + + + {% endfor %} +
+ {{ item }} +
+
+ + + \ No newline at end of file