mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-09 11:13:26 +08:00
small updates
This commit is contained in:
+2
-2
@@ -37,9 +37,9 @@ def play_unconstrained():
|
||||
if "i " == action.lower()[0:2]:
|
||||
action = action[2:]
|
||||
|
||||
action = " You " + action + ". "
|
||||
action = "\n> " + action + ".\n"
|
||||
action = remove_profanity(action)
|
||||
action = first_to_second_person(action)
|
||||
#action = first_to_second_person(action)
|
||||
|
||||
result = story_manager.act(action)
|
||||
print("\n\n" + action + result)
|
||||
|
||||
@@ -8,7 +8,7 @@ if not os.path.isdir(os.path.join("models", model_name)):
|
||||
print("Downloading ", model_name, " model...")
|
||||
gpt2.download_gpt2(model_name=model_name) # model is saved into current directory under /models/124M/
|
||||
|
||||
file_name = "merged-first-person.txt"
|
||||
file_name = "text_adventures.txt"
|
||||
|
||||
sess = gpt2.start_tf_sess()
|
||||
gpt2.finetune(sess,
|
||||
@@ -17,6 +17,6 @@ gpt2.finetune(sess,
|
||||
batch_size=8,
|
||||
learning_rate=0.0001,
|
||||
model_name=model_name,
|
||||
steps=4000)
|
||||
steps=1000)
|
||||
|
||||
gpt2.generate(sess)
|
||||
gpt2.generate(sess)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -59,8 +59,8 @@ class SimpleGenerator:
|
||||
if prompt[-1] == " ":
|
||||
prompt = prompt[:-1]
|
||||
|
||||
prompt = second_to_first_person(prompt)
|
||||
|
||||
#prompt = second_to_first_person(prompt)
|
||||
|
||||
# print("\n\nAFTER PROMPT_REPLACE")
|
||||
# print(repr(prompt))
|
||||
return prompt
|
||||
@@ -74,7 +74,7 @@ class SimpleGenerator:
|
||||
result = result.replace('."', '".')
|
||||
result = result.replace("#", "")
|
||||
result = result.replace("*", "")
|
||||
result = first_to_second_person(result)
|
||||
#result = first_to_second_person(result)
|
||||
result = remove_profanity(result)
|
||||
|
||||
if not first_letter_capitalized:
|
||||
@@ -137,7 +137,7 @@ class SimpleGenerator:
|
||||
|
||||
print("Generated result is: ", repr(gen_texts[0]))
|
||||
print("******END DEBUG******")
|
||||
result = gen_texts[0][len(prefix)+1:]
|
||||
result = gen_texts[0][len(prefix):]
|
||||
|
||||
result = self.result_replace(result)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user