This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import numpy as np | |
import torch | |
from torch.utils.data import DataLoader, Dataset, SequentialSampler, RandomSampler | |
from torch.utils.data.distributed import DistributedSampler | |
import math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.ioloop | |
import tornado.web | |
import json | |
histories = {} | |
def reply(history): | |
return ' '.join(history[-1].split()[::-1]) | |
class MainHandler(tornado.web.RequestHandler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import json | |
import numpy as np | |
parser = argparse.ArgumentParser(description='Sub-task 2 FED Script') | |
parser.add_argument('--filename', type=str, default='fed_fine-tune-on-DialoGPT-M.json') | |
args = parser.parse_args() |