diff --git a/__pycache__/generator.cpython-35.pyc b/__pycache__/generator.cpython-35.pyc new file mode 100644 index 0000000..cf66a16 Binary files /dev/null and b/__pycache__/generator.cpython-35.pyc differ diff --git a/__pycache__/main.cpython-35.pyc b/__pycache__/main.cpython-35.pyc new file mode 100644 index 0000000..9b38ea4 Binary files /dev/null and b/__pycache__/main.cpython-35.pyc differ diff --git a/__pycache__/utils.cpython-35.pyc b/__pycache__/utils.cpython-35.pyc new file mode 100644 index 0000000..95f9eee Binary files /dev/null and b/__pycache__/utils.cpython-35.pyc differ diff --git a/gpt2/__pycache__/__init__.cpython-35.pyc b/gpt2/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000..77ad1fd Binary files /dev/null and b/gpt2/__pycache__/__init__.cpython-35.pyc differ diff --git a/gpt2/src/__pycache__/encoder.cpython-35.pyc b/gpt2/src/__pycache__/encoder.cpython-35.pyc new file mode 100644 index 0000000..782140c Binary files /dev/null and b/gpt2/src/__pycache__/encoder.cpython-35.pyc differ diff --git a/gpt2/src/__pycache__/model.cpython-35.pyc b/gpt2/src/__pycache__/model.cpython-35.pyc new file mode 100644 index 0000000..1e3fe76 Binary files /dev/null and b/gpt2/src/__pycache__/model.cpython-35.pyc differ diff --git a/gpt2/src/__pycache__/sample.cpython-35.pyc b/gpt2/src/__pycache__/sample.cpython-35.pyc new file mode 100644 index 0000000..28a2ed4 Binary files /dev/null and b/gpt2/src/__pycache__/sample.cpython-35.pyc differ diff --git a/main.py b/main.py index 89a0610..3e17c1d 100644 --- a/main.py +++ b/main.py @@ -160,6 +160,11 @@ def generate_cache(): if action_results is not None: response = action_results else: + if len(choices) is 0: + prompt = retrieve_from_cache(seed, prompt_num, [], "story") + else: + prompt = retrieve_from_cache(seed, prompt_num, choices[:-1], "choices") + action_results = [generator.generate_action_result(prompt, phrase) for phrase in phrases] response = json.dumps(action_results) cache_file(seed, prompt_num, choices, response, "choices") @@ -180,7 +185,7 @@ if __name__ == '__main__': # App Engine itself will serve those files as configured in app.yaml. #with tf.Session(graph=tf.Graph()) as sess: # app.run(host='127.0.0.1', port=8090, debug=False) - + generate_cache() diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..e4e6e3d --- /dev/null +++ b/start.sh @@ -0,0 +1 @@ +./gunicorn --timeout=300 --graceful-timeout=300 -b 0.0.0.0:8010 main:app