This commit is contained in:
Nick
2019-11-01 12:54:28 -06:00
4 changed files with 24 additions and 4 deletions
+2 -3
View File
@@ -1,8 +1,7 @@
FROM nvcr.io/nvidia/tensorflow:19.08-py3
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./
RUN git clone http://github.com/nickwalton/AIDungeon.git
RUN cd AIDungeon
RUN pip install -r requirements.txt
RUN cd generator/ctrl
+1 -1
View File
@@ -25,7 +25,6 @@ def play_unconstrained():
#generator = WebGenerator(CRED_FILE)
prompt = get_story_start("apocalypse")
context = get_context("apocalypse")
story_manager = UnconstrainedStoryManager(generator)
story_manager.start_new_story(prompt, context=context)
@@ -37,6 +36,7 @@ def play_unconstrained():
if action != "":
action = action.strip()
action = action[0].lower() + action[1:]
if action[-1] == "." or action[-1] == "?" or action[-1] == "!":
+5
View File
@@ -221,6 +221,11 @@ class CTRLGenerator():
"http://www.@@", "edit@@", "*@@", "Writing", "Text@@", "\\@@", "<br>@@", "<div", "|@@", '...',
'..','', 'https://@@', '...@@']
encourage_tokens = ["zombie", "radiation", "fallout", "undead", "corpse", "vampire", "virus", "plague"]
for encourage_token in encourage_tokens:
prompt_logits[_token][self.word2idx[encourage_token]] *= 1.2
for forbidden_token in forbidden_tokens:
prompt_logits[_token][self.word2idx[forbidden_token]] = -1e8
+16
View File
@@ -119,9 +119,20 @@ first_to_second_mappings = [
("Im", "you're"),
("Ive", "you've"),
("I am", "you are"),
<<<<<<< HEAD
("I", "you"),
("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"),
>>>>>>> 93133cfce7068261e646d47faa0c84119108be4b
("my", "your"),
("we","you"),
("we're", "you're"),
@@ -137,6 +148,11 @@ second_to_first_mappings = [
("you're", "I'm"),
("your", "my"),
("you are", "I am"),
<<<<<<< HEAD
=======
("you were", "I was"),
("are you", "am I"),
>>>>>>> 93133cfce7068261e646d47faa0c84119108be4b
("you", "I"),
("you", "me"),
("you'll", "I'll"),