mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-09 11:13:26 +08:00
update
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
fastBPE
|
||||
model
|
||||
@@ -23,7 +23,7 @@ class CTRLGenerator():
|
||||
def __init__(self, control_code="Writing Text: ", generate_num=64, temperature=0.5, topk=40):
|
||||
|
||||
self.generate_num=generate_num
|
||||
model_dir = "generator/ctrl/model/seqlen512_v1.ckpt/"
|
||||
model_dir = "generator/ctrl/training_utils/seqlen512_v1.ckpt/"
|
||||
self.control_code = control_code
|
||||
vocab_file = 'generator/ctrl/model/vocab'
|
||||
code_file = 'generator/ctrl/model/codes'
|
||||
|
||||
@@ -4,11 +4,8 @@ cd model
|
||||
# Cython is needed to compile fastBPE
|
||||
pip install Cython
|
||||
|
||||
pip install tensorflow-gpu==1.14
|
||||
pip install keras
|
||||
|
||||
# Patch the TensorFlow estimator package
|
||||
FILE="/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator"
|
||||
export FILE="/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/keras.py"
|
||||
patch -b "$FILE" estimator.patch
|
||||
|
||||
# Install fastBPE
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
47c47
|
||||
<
|
||||
---
|
||||
> import tensorflow as tf
|
||||
228c228
|
||||
< def _create_keras_model_fn(keras_model, custom_objects=None):
|
||||
---
|
||||
> def _create_keras_model_fn(keras_model, params=None, custom_objects=None):
|
||||
239c239
|
||||
< def model_fn(features, labels, mode):
|
||||
---
|
||||
> def model_fn(features, labels, mode, params=None):
|
||||
448c448
|
||||
< if keras_model._is_graph_network:
|
||||
---
|
||||
> if False:
|
||||
462,464c462,464
|
||||
< estimator = estimator_lib.Estimator(keras_model_fn,
|
||||
< config=config,
|
||||
< warm_start_from=warm_start_path)
|
||||
---
|
||||
> estimator = tf.contrib.tpu.TPUEstimator(keras_model_fn, use_tpu=True, train_batch_size=512, eval_batch_size=32,
|
||||
> config=config,
|
||||
> warm_start_from=warm_start_path)
|
||||
@@ -0,0 +1,3 @@
|
||||
seqlen256_v1.ckpt
|
||||
*.txt
|
||||
*.tfrecords
|
||||
Reference in New Issue
Block a user