Spaces:
Runtime error
Runtime error
Dusan Svilarkovic
commited on
Commit
β’
a10a948
1
Parent(s):
6b337ea
Try it
Browse files- app.py +4 -10
- {naacl-2021-fudge-controlled-generation β fudge}/LICENSE +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/README.md +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/clickbait_classifier.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/constants.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/data.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/eval_formality_metrics.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/eval_poetry_metrics.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/eval_topic_metrics.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/evaluate_clickbait.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/evaluate_formality.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/evaluate_poetry.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/evaluate_topic.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/formality_data/README.md +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/formality_data/fisher_test_oracle.es +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/formality_data/test.noid.cleaned_0 +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/formality_data/test.noid.cleaned_1 +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/main.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/model.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/poetry_data/README.md +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/poetry_data/couplet_ends.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/poetry_data/couplet_prefixes.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/poetry_util.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/predict_clickbait.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/predict_formality.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/predict_poetry.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/predict_topic.py +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/requirements.txt +4 -1
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/README.md +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/computers.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/legal.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/military.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/politics.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/religion.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/science.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/space.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/topic_prefixes.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/val_wordlists/fantasy.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/computers.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/legal.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/military.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/politics.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/religion.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/science.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/space.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/transcript.txt +0 -0
- {naacl-2021-fudge-controlled-generation β fudge}/util.py +0 -0
- requirements.txt +10 -0
app.py
CHANGED
@@ -3,7 +3,7 @@ import os
|
|
3 |
os.chdir('naacl-2021-fudge-controlled-generation/')
|
4 |
|
5 |
import gradio as gr
|
6 |
-
from predict_clickbait import generate_clickbait
|
7 |
from datasets import load_dataset,DatasetDict,Dataset
|
8 |
# from datasets import
|
9 |
from transformers import AutoTokenizer,AutoModelForSeq2SeqLM
|
@@ -13,13 +13,8 @@ import pandas as pd
|
|
13 |
from sklearn.utils.class_weight import compute_class_weight
|
14 |
import torch
|
15 |
import pandas as pd
|
16 |
-
from model import Model
|
17 |
-
import imp
|
18 |
import os
|
19 |
-
import random
|
20 |
-
import time
|
21 |
-
import pickle
|
22 |
-
import math
|
23 |
from argparse import ArgumentParser
|
24 |
from collections import namedtuple
|
25 |
import mock
|
@@ -29,9 +24,8 @@ import numpy as np
|
|
29 |
import torch.nn as nn
|
30 |
import torch.nn.functional as F
|
31 |
from data import Dataset
|
32 |
-
from util import save_checkpoint, ProgressMeter, AverageMeter, num_params
|
33 |
-
from constants import *
|
34 |
-
from predict_clickbait import generate_clickbait, tokenizer, classifier_tokenizer
|
35 |
|
36 |
|
37 |
# imp.reload(model)
|
|
|
3 |
os.chdir('naacl-2021-fudge-controlled-generation/')
|
4 |
|
5 |
import gradio as gr
|
6 |
+
from fudge.predict_clickbait import generate_clickbait, tokenizer, classifier_tokenizer
|
7 |
from datasets import load_dataset,DatasetDict,Dataset
|
8 |
# from datasets import
|
9 |
from transformers import AutoTokenizer,AutoModelForSeq2SeqLM
|
|
|
13 |
from sklearn.utils.class_weight import compute_class_weight
|
14 |
import torch
|
15 |
import pandas as pd
|
16 |
+
from fudge.model import Model
|
|
|
17 |
import os
|
|
|
|
|
|
|
|
|
18 |
from argparse import ArgumentParser
|
19 |
from collections import namedtuple
|
20 |
import mock
|
|
|
24 |
import torch.nn as nn
|
25 |
import torch.nn.functional as F
|
26 |
from data import Dataset
|
27 |
+
from fudge.util import save_checkpoint, ProgressMeter, AverageMeter, num_params
|
28 |
+
from fudge.constants import *
|
|
|
29 |
|
30 |
|
31 |
# imp.reload(model)
|
{naacl-2021-fudge-controlled-generation β fudge}/LICENSE
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/README.md
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/clickbait_classifier.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/constants.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/data.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/eval_formality_metrics.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/eval_poetry_metrics.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/eval_topic_metrics.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/evaluate_clickbait.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/evaluate_formality.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/evaluate_poetry.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/evaluate_topic.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/formality_data/README.md
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/formality_data/fisher_test_oracle.es
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/formality_data/test.noid.cleaned_0
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/formality_data/test.noid.cleaned_1
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/main.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/model.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/poetry_data/README.md
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/poetry_data/couplet_ends.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/poetry_data/couplet_prefixes.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/poetry_util.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/predict_clickbait.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/predict_formality.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/predict_poetry.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/predict_topic.py
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/requirements.txt
RENAMED
@@ -2,6 +2,9 @@ Phyme==0.0.9
|
|
2 |
pronouncing==0.2.0
|
3 |
pytorch-lightning==1.0.6
|
4 |
torch==1.7.0
|
5 |
-
tqdm==4.
|
6 |
sacrebleu==1.4.14
|
7 |
sacremoses==0.0.43
|
|
|
|
|
|
|
|
2 |
pronouncing==0.2.0
|
3 |
pytorch-lightning==1.0.6
|
4 |
torch==1.7.0
|
5 |
+
tqdm==4.62.1
|
6 |
sacrebleu==1.4.14
|
7 |
sacremoses==0.0.43
|
8 |
+
mock==4.0.3
|
9 |
+
torchtext==0.8.1 --no-deps
|
10 |
+
torchvision==0.8.2 --no-deps
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/README.md
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/computers.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/legal.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/military.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/politics.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/religion.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/science.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/test_wordlists/space.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/topic_prefixes.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/val_wordlists/fantasy.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/computers.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/legal.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/military.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/politics.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/religion.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/science.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/topic_data/wordlists/space.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/transcript.txt
RENAMED
File without changes
|
{naacl-2021-fudge-controlled-generation β fudge}/util.py
RENAMED
File without changes
|
requirements.txt
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Phyme==0.0.9
|
2 |
+
pronouncing==0.2.0
|
3 |
+
pytorch-lightning==1.0.6
|
4 |
+
torch==1.7.0
|
5 |
+
tqdm==4.62.1
|
6 |
+
sacrebleu==1.4.14
|
7 |
+
sacremoses==0.0.43
|
8 |
+
mock==4.0.3
|
9 |
+
torchtext==0.8.1 --no-deps
|
10 |
+
torchvision==0.8.2 --no-deps
|