AhmedSSabir commited on
Commit
18cd94a
1 Parent(s): 50ee6f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -20,8 +20,8 @@ from sentence_transformers import SentenceTransformer, util
20
 
21
  #model_sts = gr.Interface.load('huggingface/sentence-transformers/stsb-distilbert-base')
22
 
23
- model_sts = SentenceTransformer('stsb-distilbert-base')
24
-
25
  #batch_size = 1
26
  #scorer = LMScorer.from_pretrained('gpt2' , device=device, batch_size=batch_size)
27
 
@@ -53,14 +53,15 @@ def get_sim(x):
53
 
54
  # Load pre-trained model
55
 
56
- model = GPT2LMHeadModel.from_pretrained('distilgpt2', output_hidden_states = True, output_attentions = True)
57
-
58
  #model = gr.Interface.load('huggingface/distilgpt2', output_hidden_states = True, output_attentions = True)
59
 
60
  #model.eval()
61
  #tokenizer = gr.Interface.load('huggingface/distilgpt2')
62
 
63
- tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2')
 
64
  #tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2')
65
 
66
 
 
20
 
21
  #model_sts = gr.Interface.load('huggingface/sentence-transformers/stsb-distilbert-base')
22
 
23
+ #model_sts = SentenceTransformer('stsb-distilbert-base')
24
+ model_sts = SentenceTransformer('roberta-large-nli-stsb-mean-tokens')
25
  #batch_size = 1
26
  #scorer = LMScorer.from_pretrained('gpt2' , device=device, batch_size=batch_size)
27
 
 
53
 
54
  # Load pre-trained model
55
 
56
+ #model = GPT2LMHeadModel.from_pretrained('distilgpt2', output_hidden_states = True, output_attentions = True)
57
+ model = GPT2LMHeadModel.from_pretrained('gpt2', output_hidden_states = True, output_attentions = True)
58
  #model = gr.Interface.load('huggingface/distilgpt2', output_hidden_states = True, output_attentions = True)
59
 
60
  #model.eval()
61
  #tokenizer = gr.Interface.load('huggingface/distilgpt2')
62
 
63
+ #tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2')
64
+ tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
65
  #tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2')
66
 
67