This commit is contained in:
nickwalton
2019-11-01 15:34:07 -06:00
13 changed files with 49 additions and 11 deletions
+5
View File
@@ -0,0 +1,5 @@
Dockerfile
README.md
*.pyc
*.pyo
__pycache__
+14
View File
@@ -0,0 +1,14 @@
FROM nvcr.io/nvidia/tensorflow:19.08-py3
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./
RUN pip install -r requirements.txt
WORKDIR generator/ctrl
RUN ls
RUN sh install_ctrl_py3.sh
RUN sh download_model.sh
WORKDIR $APP_HOME
CMD exec guincorn --bind :%PORT --workers 1 --threads 8 app:app
+3
View File
@@ -29,11 +29,14 @@ def play_unconstrained():
story_manager.start_new_story(prompt, context=context)
print("\n")
print(context)
console_print(str(story_manager.story))
while (True):
action = input("> ")
if action != "":
action = action.strip()
action = action[0].lower() + action[1:]
if action[-1] == "." or action[-1] == "?" or action[-1] == "!":
+13
View File
@@ -0,0 +1,13 @@
import os
import flask
import Flask
app = Flask(__name__)
@app.route("/")
def hellp_world():
target = os.environ.get('TARGET', 'World')
return 'Hello {}!\n'.format(target)
if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0', port=int(os.environ.get('PORT', 8080)))
+1 -1
View File
@@ -23,7 +23,7 @@ class CTRLGenerator():
def __init__(self, control_code="Apocalypse ", generate_num=28, temperature=0.5, topk=40, nucleus_prob=0):
self.generate_num=generate_num
model_dir = "generator/ctrl/training_utils/seqlen256_v1.ckpt/"
model_dir = "generator/ctrl/model/aidungeon2model/"
self.control_code = control_code
vocab_file = 'generator/ctrl/model/vocab'
code_file = 'generator/ctrl/model/codes'
+2 -6
View File
@@ -1,8 +1,4 @@
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
gcloud init
URL="gs://aidungeon2model"
URL="gs://sf-ctrl/seqlen512_v1.ckpt/"
gsutil -m cp -r "$URL" model
gsutil -m cp -r "$URL" model
-3
View File
@@ -1,3 +0,0 @@
URL="gs://first-person-fantasy/merged-first-person.txt"
gsutil -m cp -r "$URL" training_utils
+3
View File
@@ -0,0 +1,3 @@
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
gcloud init
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+8 -1
View File
@@ -126,6 +126,13 @@ first_to_second_mappings = [
("I'd", "you'd"),
("i", "you"),
("I've", "you've"),
("was I", "were you"),
("am I", "are you"),
("wasn't I", "weren't you"),
("I", "you"),
("I'd", "you'd"),
("i", "you"),
("I've", "you've"),
("I was", "you were"),
("my", "your"),
("we","you"),
@@ -207,4 +214,4 @@ if __name__ == '__main__':
while ("\n \n \n " in result):
result = result.replace("\n \n \n ", "\n \n ")
print(result)
print(result)