akshaytrikha commited on
Commit
743b460
β€’
1 Parent(s): e7a9f5e

move model files into ./model

Browse files
.DS_Store ADDED
Binary file (6.15 kB). View file
 
app.py CHANGED
@@ -5,13 +5,9 @@ import torch
5
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
6
 
7
  # load pretrained + finetuned GPT2
8
- model = GPT2LMHeadModel.from_pretrained("./model", from_pt=True)
9
- # model = GPT2LMHeadModel.from_pretrained("/zxc/model_epoch40_50w")
10
  model = model.to(device)
11
 
12
-
13
- # generator = pipeline('text-generation', model=model)
14
-
15
  trump = pipeline("text-generation", model=model, tokenizer=tokenizer, config={"max_length":140})
16
 
17
  def generate(text):
 
5
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
6
 
7
  # load pretrained + finetuned GPT2
8
+ model = GPT2LMHeadModel.from_pretrained("./model")
 
9
  model = model.to(device)
10
 
 
 
 
11
  trump = pipeline("text-generation", model=model, tokenizer=tokenizer, config={"max_length":140})
12
 
13
  def generate(text):
config.json β†’ model/config.json RENAMED
File without changes
pytorch_model.bin β†’ model/pytorch_model.bin RENAMED
File without changes
training_args.bin β†’ model/training_args.bin RENAMED
File without changes