minimised stuff for django and added html linebreak for prettyfication

master
Tom Weber 2 years ago
parent 29dc916bd1
commit 96e7dcc902

@ -3,7 +3,6 @@ attrs==21.4.0
black==22.1.0
certifi==2021.10.8
charset-normalizer==2.0.11
click==8.0.3
codecov==2.1.12
coverage==6.3.1
flake8==4.0.1

@ -1,20 +0,0 @@
+++
title = "Drama of the Day"
date = "2021-11-07"
+++
This excerpt of a drama, although inspired by Shakespeare, is entirely artificially generated.
The language model that was used to produce this text only had prior knowledge about the latin alphabet.
All the (pseudo-)words produced were learnt through imitating Shakespeare. Therefore, you might find quite a few neologisms, in true Shakespearean spirit.
Every day, the model is told to use the prompt **TOM:** and then produces the rest up to 10000 characters, thereby creating a unique new drama.
If you like to know more about this, [click here](https://git.weber.codes/tom/DOTD_generator).
---

File diff suppressed because it is too large Load Diff

@ -3,7 +3,6 @@
import re
import os
import torch
import click
from dotd.model import GRU
from dotd.data import get_shakespeare, preprocess
@ -29,8 +28,10 @@ def load_model(alphabet_size: int, path: str = "saved_models/rnn_2epochs.pth") -
return gru.eval()
def make_pretty(text: str) -> str:
def make_pretty(text: str, html=False) -> str:
"""delete some line breaks for markdown"""
if html:
return re.sub(r"\n", r"<br>", text)
return re.sub(r"\n", r"<br>\n", text)
@ -58,10 +59,6 @@ def write_drama(seq, temp=0.7, max_seq_len=1000):
return seq
@click.command()
@click.option(
"--output", type=str, default="./dramaoftheday.md", help="Output file path"
)
def main(output):
print(__file__)
"""main function"""

Loading…
Cancel
Save