mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-10 11:40:48 +08:00
update
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ def play_unconstrained():
|
||||
generator = CTRLGenerator()
|
||||
#generator = WebGenerator(CRED_FILE)
|
||||
if len(sys.argv) is 1:
|
||||
prompt = get_story_start("hospital")
|
||||
prompt = get_story_start("forest")
|
||||
else:
|
||||
prompt = sys.argv[1]
|
||||
story_manager = UnconstrainedStoryManager(generator)
|
||||
|
||||
@@ -20,10 +20,10 @@ def loss(labels, logits):
|
||||
|
||||
class CTRLGenerator():
|
||||
|
||||
def __init__(self, control_code="Writing Text: ", generate_num=64, temperature=0.5, topk=40):
|
||||
def __init__(self, control_code="Fantasy ", generate_num=64, temperature=0.5, topk=40):
|
||||
|
||||
self.generate_num=generate_num
|
||||
model_dir = "generator/ctrl/training_utils/seqlen512_v1.ckpt/"
|
||||
model_dir = "generator/ctrl/training_utils/seqlen256_v1.ckpt/"
|
||||
self.control_code = control_code
|
||||
vocab_file = 'generator/ctrl/model/vocab'
|
||||
code_file = 'generator/ctrl/model/codes'
|
||||
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd model
|
||||
# Cython is needed to compile fastBPE
|
||||
pip install Cython
|
||||
|
||||
# Patch the TensorFlow estimator package
|
||||
export FILE="/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/keras.py"
|
||||
patch -b "$FILE" estimator.patch
|
||||
|
||||
# Install fastBPE
|
||||
git clone https://github.com/glample/fastBPE.git
|
||||
cd fastBPE
|
||||
python setup.py install
|
||||
cd ../..
|
||||
|
||||
# Download the 512-length model if specified, 256-length otherwise
|
||||
#if [ "$1" = "512" ]
|
||||
#then
|
||||
# URL="gs://sf-ctrl/seqlen512_v1.ckpt/"
|
||||
#else
|
||||
# URL="gs://sf-ctrl/seqlen256_v1.ckpt/"
|
||||
#fi
|
||||
|
||||
# Copy model
|
||||
#gsutil -m cp -r "$URL" .
|
||||
|
||||
Reference in New Issue
Block a user