updated caching script

This commit is contained in:
Nick Walton
2019-04-09 01:27:42 +00:00
parent 8a9c51a27c
commit fea095a05a
9 changed files with 7 additions and 1 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6 -1
View File
@@ -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()
+1
View File
@@ -0,0 +1 @@
./gunicorn --timeout=300 --graceful-timeout=300 -b 0.0.0.0:8010 main:app