Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Turing-Project/WriteGPT
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0
Choose a base ref
...
head repository: Turing-Project/WriteGPT
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Oct 1, 2020

  1. fix typo

    Y1ran committed Oct 1, 2020
    Copy the full SHA
    3c4b95e View commit details
  2. Update README.md

    Y1ran authored Oct 1, 2020
    Copy the full SHA
    0465c77 View commit details
  3. params

    Y1ran committed Oct 1, 2020
    Copy the full SHA
    da8dddb View commit details

Commits on Oct 3, 2020

  1. Update README.md

    Y1ran authored Oct 3, 2020
    Copy the full SHA
    43966f1 View commit details

Commits on Oct 25, 2020

  1. fix

    Y1ran committed Oct 25, 2020
    Copy the full SHA
    61dbfc7 View commit details
  2. Copy the full SHA
    0d4eaac View commit details
  3. fix_bug2

    Y1ran committed Oct 25, 2020
    Copy the full SHA
    b22f345 View commit details
  4. fix3

    Y1ran committed Oct 25, 2020
    Copy the full SHA
    cdeb7e8 View commit details
  5. Update README.md

    Y1ran authored Oct 25, 2020
    Copy the full SHA
    026f6ea View commit details
  6. Update README.md

    Y1ran authored Oct 25, 2020
    Copy the full SHA
    6b23e0a View commit details
  7. fix5

    Y1ran committed Oct 25, 2020
    Copy the full SHA
    160ca22 View commit details

Commits on Oct 26, 2020

  1. fix5

    Y1ran committed Oct 26, 2020
    Copy the full SHA
    5e8ebce View commit details
  2. Copy the full SHA
    ade7573 View commit details
  3. debug2

    Y1ran committed Oct 26, 2020
    Copy the full SHA
    e4a3cc6 View commit details
  4. fix3

    Y1ran committed Oct 26, 2020
    Copy the full SHA
    b7f5759 View commit details

Commits on Nov 8, 2020

  1. upfix

    Y1ran committed Nov 8, 2020
    Copy the full SHA
    0ba4484 View commit details
  2. upfix2

    Y1ran committed Nov 8, 2020
    Copy the full SHA
    96fc6c0 View commit details
  3. upfix

    Y1ran committed Nov 8, 2020
    Copy the full SHA
    944f1cf View commit details
  4. fix

    Y1ran committed Nov 8, 2020
    Copy the full SHA
    9fbeae4 View commit details

Commits on Nov 9, 2020

  1. fix

    Y1ran committed Nov 9, 2020
    Copy the full SHA
    40fd42e View commit details

Commits on Nov 10, 2020

  1. fix

    Y1ran committed Nov 10, 2020
    Copy the full SHA
    d24c787 View commit details

Commits on Jun 10, 2021

  1. add new train corpus

    Y1ran authored Jun 10, 2021
    Copy the full SHA
    d4a2742 View commit details
  2. add explain

    Y1ran authored Jun 10, 2021
    1
    Copy the full SHA
    8023f29 View commit details

Commits on Dec 8, 2021

  1. Update js_data

    Y1ran authored Dec 8, 2021
    Copy the full SHA
    3cd8691 View commit details
  2. Update init.txt

    Y1ran authored Dec 8, 2021
    Copy the full SHA
    8b886f1 View commit details

Commits on Dec 12, 2021

  1. Update colab_online.ipynb

    Y1ran authored Dec 12, 2021
    2
    Copy the full SHA
    a638095 View commit details
  2. Update colab_online.ipynb

    Y1ran authored Dec 12, 2021
    Copy the full SHA
    980cf8c View commit details
  3. Update demo.py

    Y1ran authored Dec 12, 2021
    Copy the full SHA
    92d21c1 View commit details

Commits on Jun 8, 2022

  1. Update colab_online.ipynb

    Y1ran authored Jun 8, 2022
    Copy the full SHA
    425147a View commit details

Commits on Jun 9, 2022

  1. Update gdown.pl

    trustyboy authored Jun 9, 2022
    Copy the full SHA
    4e3032f View commit details

Commits on Jun 11, 2022

  1. Merge pull request #36 from trustyboy/master

    修复colab模型框架加载模块卡住问题
    Y1ran authored Jun 11, 2022
    Copy the full SHA
    9ed28e3 View commit details

Commits on Sep 18, 2022

  1. Update README.md

    Y1ran authored Sep 18, 2022
    Copy the full SHA
    d4eaa08 View commit details
  2. Update README.md

    Y1ran authored Sep 18, 2022
    Copy the full SHA
    cd8ebe6 View commit details
  3. Update README.md

    Y1ran authored Sep 18, 2022
    Copy the full SHA
    a92be9b View commit details
  4. Update README.md

    Y1ran authored Sep 18, 2022
    Copy the full SHA
    0ebf1f8 View commit details

Commits on Sep 19, 2022

  1. Update README.md

    Y1ran authored Sep 19, 2022
    Copy the full SHA
    67b188d View commit details

Commits on Dec 14, 2022

  1. Copy the full SHA
    ed1024b View commit details

Commits on Feb 13, 2023

  1. Update README.md

    Y1ran authored Feb 13, 2023
    Copy the full SHA
    d5341f5 View commit details
  2. Update README.md

    Y1ran authored Feb 13, 2023
    Copy the full SHA
    97ca3b3 View commit details

Commits on Feb 16, 2023

  1. Copy the full SHA
    98f9dad View commit details
Binary file added .vs/EssayKiller_V2/v16/.suo
Binary file not shown.
12 changes: 12 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ExpandedNodes": [
"",
"\\LanguageNetwork",
"\\LanguageNetwork\\GPT2",
"\\LanguageNetwork\\GPT2\\finetune",
"\\LanguageNetwork\\GPT2\\finetune\\trained_model",
"\\LanguageNetwork\\GPT2\\scripts"
],
"SelectedNode": "\\colab_online.ipynb",
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
21 changes: 20 additions & 1 deletion LanguageNetwork/BERT/models/pytorch_pretrained_bert/modeling.py
Original file line number Diff line number Diff line change
@@ -595,7 +595,26 @@ def from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs):
logger.info("extracting archive file {} to temp dir {}".format(
resolved_archive_file, tempdir))
with tarfile.open(resolved_archive_file, 'r:gz') as archive:
archive.extractall(tempdir)
def is_within_directory(directory, target):

abs_directory = os.path.abspath(directory)
abs_target = os.path.abspath(target)

prefix = os.path.commonprefix([abs_directory, abs_target])

return prefix == abs_directory

def safe_extract(tar, path=".", members=None, *, numeric_owner=False):

for member in tar.getmembers():
member_path = os.path.join(path, member.name)
if not is_within_directory(path, member_path):
raise Exception("Attempted Path Traversal in Tar File")

tar.extractall(path, members, numeric_owner=numeric_owner)


safe_extract(archive, tempdir)
serialization_dir = tempdir
# Load config
config_file = os.path.join(serialization_dir, CONFIG_NAME)
2 changes: 1 addition & 1 deletion LanguageNetwork/GPT2/js_data
Original file line number Diff line number Diff line change
@@ -51,6 +51,6 @@
{"text": "麦田也早已消失多年,枣树还是向外伸展着枝干,却早已失去了往日的活力,我只看到仅留的枯枝摇摇欲坠,一触即落。  或许,十年后,我在从这条小路上经过时,却很难再次找到儿时的感觉。那时候各式各样的广告灯会不会侵占行道树下闪烁不定的光斑?商店里的音响会不会代替草地里的虫鸣?城市的灯红酒绿会不会取代自然的安逸?  清晨,第一辆车呼啸而过,接着就开始了人们的嘈杂。汽车骄傲的喷着气,鸣着笛,不一会儿路上车水马龙。一个美妙的梦境就这样破碎。\n  成熟在《现代汉语词典》中的解释是“植物的果实等完全长成,泛指生物体发育到完备状态”。而在哲学家尼采眼中“真正的成熟,应当是独特个性的形成,真正自我的实现,精神上的结果和丰收”。前者泛指一种生理状态,后者特指人心智上的成熟,和为人处世的一种态度。  七堇年曾经说过:“生活以刻薄和荒芜相欺”。生活其实就是一个不断完善自己的过程。而这个过程充斥着泥淖与罹难。而我们则像被诸神惩罚的西西弗斯。"}
{"text": "汽车骄傲的喷着气,鸣着笛,不一会儿路上车水马龙。一个美妙的梦境就这样破碎。\n  成熟在《现代汉语词典》中的解释是“植物的果实等完全长成,泛指生物体发育到完备状态”。而在哲学家尼采眼中“真正的成熟,应当是独特个性的形成,真正自我的实现,精神上的结果和丰收”。前者泛指一种生理状态,后者特指人心智上的成熟,和为人处世的一种态度。  七堇年曾经说过:“生活以刻薄和荒芜相欺”。生活其实就是一个不断完善自己的过程。而这个过程充斥着泥淖与罹难。而我们则像被诸神惩罚的西西弗斯。终日重复着单调枯燥的劳作以至于在生活的泥淖中迷失了自己,终究也完不成成熟的蜕变了。  而对于“鸟儿在枪声中折羽,花儿在清晨就香消玉殒”的生活,我们真的要放弃成长,永远幼稚下去吗?  不!当然不!正如罗素所说“参差多姿乃幸福本源”或许生活的泥淖黑暗且未知,但依然充满着希望,执着的探寻一定能找到希望。"}
{"text": "而在哲学家尼采眼中“真正的成熟,应当是独特个性的形成,真正自我的实现,精神上的结果和丰收”。前者泛指一种生理状态,后者特指人心智上的成熟,和为人处世的一种态度。  七堇年曾经说过:“生活以刻薄和荒芜相欺”。生活其实就是一个不断完善自己的过程。而这个过程充斥着泥淖与罹难。而我们则像被诸神惩罚的西西弗斯。终日重复着单调枯燥的劳作以至于在生活的泥淖中迷失了自己,终究也完不成成熟的蜕变了。  而对于“鸟儿在枪声中折羽,花儿在清晨就香消玉殒”的生活,我们真的要放弃成长,永远幼稚下去吗?  不!当然不!正如罗素所说“参差多姿乃幸福本源”或许生活的泥淖黑暗且未知,但依然充满着希望,执着的探寻一定能找到希望。  普雅花,静候九十年,只为一朝绽放。朝菌不知晦朔,蟪蛄不知春秋。对于普雅花成熟是一种对于美丽的漫长等待。而对于朝菌、蟪蛄,成熟不过是一种介于生与死之间的一种生理状态。我们没法判断哪一个的生命更有意义,而可以肯定的是前者的生命更加痛苦但也更有希望。"}
{"text": "  七堇年曾经说过:“生活以刻薄和荒芜相欺”。生活其实就是一个不断完善自己的过程。而这个过程充斥着泥淖与罹难。而我们则像被诸神惩罚的西西弗斯。终日重复着单调枯燥的劳作以至于在生活的泥淖中迷失了自己,终究也完不成成熟的蜕变了。  而对于“鸟儿在枪声中折羽,花儿在清晨就香消玉殒”的生活,我们真的要放弃成长,永远幼稚下去吗?  不!当然不!正如罗素所说“参差多姿乃幸福本源”或许生活的泥淖黑暗且未知,但依然充满着希望,执着的探寻一定能找到希望。  普雅花,静候九十年,只为一朝绽放。朝菌不知晦朔,蟪蛄不知春秋。对于普雅花成熟是一种对于美丽的漫长等待。而对于朝菌、蟪蛄,成熟不过是一种介于生与死之间的一种生理状态。我们没法判断哪一个的生命更有意义,而可以肯定的是前者的生命更加痛苦但也更有希望。  海明威说过:“生活总是让我们遍体鳞伤,但到最后那些受伤的地方一定会变成我们最强壮的地方。”生活到处充满着痛苦的泥淖,这就需要我们以一种成熟的姿态来跨越。而这种成熟便是尼采眼中的“真正的成熟”,也是一种像马丁路德金说的“无论做什么,都要保持前进的方向”的永远向前的态度。"}
{"text": "  七堇年曾经说过:“生活以刻薄和荒芜相欺”。生活其实就是一个不断完善自己的过程。而这个过程充斥着泥淖与罹难。而我们则像被诸神惩罚的西西弗斯。终日重复着单调枯燥的劳作以至于在生活的泥淖中迷失了自己,终究也完不成成熟的蜕变了。  而对于“鸟儿在枪声中折羽,花儿在清晨就香消玉殒”的生活,我们真的要放弃成长,永远幼稚下去吗?  当然不!正如罗素所说“参差多姿乃幸福本源”或许生活的泥淖黑暗且未知,但依然充满着希望,执着的探寻一定能找到希望。  普雅花,静候九十年,只为一朝绽放。朝菌不知晦朔,蟪蛄不知春秋。对于普雅花成熟是一种对于美丽的漫长等待。而对于朝菌、蟪蛄,成熟不过是一种介于生与死之间的一种生理状态。我们没法判断哪一个的生命更有意义,而可以肯定的是前者的生命更加痛苦但也更有希望。  海明威说过:“生活总是让我们遍体鳞伤,但到最后那些受伤的地方一定会变成我们最强壮的地方。”生活到处充满着痛苦的泥淖,这就需要我们以一种成熟的姿态来跨越。而这种成熟便是尼采眼中的“真正的成熟”,也是一种像马丁路德金说的“无论做什么,都要保持前进的方向”的永远向前的态度。"}
{"text": "  而对于“鸟儿在枪声中折羽,花儿在清晨就香消玉殒”的生活,我们真的要放弃成长,永远幼稚下去吗?  不!当然不!正如罗素所说“参差多姿乃幸福本源”或许生活的泥淖黑暗且未知,但依然充满着希望,执着的探寻一定能找到希望。  普雅花,静候九十年,只为一朝绽放。朝菌不知晦朔,蟪蛄不知春秋。对于普雅花成熟是一种对于美丽的漫长等待。而对于朝菌、蟪蛄,成熟不过是一种介于生与死之间的一种生理状态。我们没法判断哪一个的生命更有意义,而可以肯定的是前者的生命更加痛苦但也更有希望。  海明威说过:“生活总是让我们遍体鳞伤,但到最后那些受伤的地方一定会变成我们最强壮的地方。”生活到处充满着痛苦的泥淖,这就需要我们以一种成熟的姿态来跨越。而这种成熟便是尼采眼中的“真正的成熟”,也是一种像马丁路德金说的“无论做什么,都要保持前进的方向”的永远向前的态度。  所以,无论命运多么晦暗,无论人生有多少次颠簸,苦难的渡口总会有帮你度过苦难的渡船,而这渡船便是以坚持为桨,以信念为舵,以成熟之姿飞跃苦难的海洋。  成熟之姿,便是前往,无论前路天寒地冻,路遥马亡。成熟之姿,便是阳光,穿越苦难温暖的照在人的心上。"}
{"text": "朝菌不知晦朔,蟪蛄不知春秋。对于普雅花成熟是一种对于美丽的漫长等待。而对于朝菌、蟪蛄,成熟不过是一种介于生与死之间的一种生理状态。我们没法判断哪一个的生命更有意义,而可以肯定的是前者的生命更加痛苦但也更有希望。  海明威说过:“生活总是让我们遍体鳞伤,但到最后那些受伤的地方一定会变成我们最强壮的地方。”生活到处充满着痛苦的泥淖,这就需要我们以一种成熟的姿态来跨越。而这种成熟便是尼采眼中的“真正的成熟”,也是一种像马丁路德金说的“无论做什么,都要保持前进的方向”的永远向前的态度。  所以,无论命运多么晦暗,无论人生有多少次颠簸,苦难的渡口总会有帮你度过苦难的渡船,而这渡船便是以坚持为桨,以信念为舵,以成熟之姿飞跃苦难的海洋。  成熟之姿,便是前往,无论前路天寒地冻,路遥马亡。成熟之姿,便是阳光,穿越苦难温暖的照在人的心上。就如黑塞所言“人一生唯一的使命就是找到自己,然后在心底坚守其一生。”而坚守的信念,便是以成熟之姿。  凡心所向,素履所往。生如逆旅,不如以成熟之姿,努力飞翔。"}
22 changes: 11 additions & 11 deletions LanguageNetwork/GPT2/scripts/demo.py
Original file line number Diff line number Diff line change
@@ -177,18 +177,18 @@ def extract_generated_target(output_tokens, tokenizer):

saver = tf.compat.v1.train.Saver()
saver.restore(sess, args.ckpt_fn)
print('模型加载好啦!🍺Bilibili干杯🍺 \n')
print('现在将你的作文题精简为一个句子,粘贴到这里:⬇️,然后回车')
print('模型加载好啦!🍺干杯🍺 \n')
print('现在将你的问题精简为一个句子,粘贴到这里:⬇️,然后回车')
print("\n")
print("**********************************************作文题目**********************************************\n")
print("**********************************************你的问题**********************************************\n")
text = input()
print("\n")
print("**********************************************作文题目**********************************************\n")
print("**********************************************你的问题**********************************************\n")
while text != "":
for i in range(args.samples):
print("正在生成第,", i + 1, " of ", args.samples , "篇文章\n")
print("正在生成第 ", i + 1, " of ", args.samples , "篇回答\n")
print("......\n")
print("EssayKilelr正在飞速写作中,请稍后......\n")
print("EssayKiller正在飞速写作中,请稍后......\n")

line = convert_to_unicode(text)
bert_tokens = tokenizer.tokenize(line)
@@ -216,11 +216,11 @@ def extract_generated_target(output_tokens, tokenizer):
final_output = coarse_formatter("".join(l))
immediate_print('排版结束,正在输出......\n', final_output)
print("\n")
print("把👆复制到Word或其他编辑器中即可转为标准作文排版\n")
print("把👆复制到Word或其他编辑器中即可转为标准格式排版\n")

print('对作文不满意?想尝试更多题目? 你可以继续在这里输入:⬇️')
print("**********************************************作文题目**********************************************\n")
print('对回答不满意?想尝试更多题目? 你可以继续在这里输入:⬇️')
print("**********************************************新的问题**********************************************\n")
text = input()
print("\n")
print("**********************************************作文题目**********************************************\n")

print("**********************************************新的问题**********************************************\n")

Loading