Spaces:
Runtime error
Runtime error
Commit
·
adebbc8
1
Parent(s):
523d9cf
LENGTH CHANGED
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ tokenizer=GPT2Tokenizer.from_pretrained('pushkarraj/opt_paraphraser',truncation=
|
|
12 |
generator=pipeline("text-generation",model=model,tokenizer=tokenizer,device=device)
|
13 |
|
14 |
def cleaned_para(input_sentence):
|
15 |
-
p=generator('<s>'+input_sentence+ '</s>>>>><p>',do_sample=True,max_length=len(input_sentence.split(" "))+
|
16 |
return p[0]['generated_text'].split('</s>>>>><p>')[1].split('</p>')[0]
|
17 |
|
18 |
from spacy.lang.en import English # updated
|
|
|
12 |
generator=pipeline("text-generation",model=model,tokenizer=tokenizer,device=device)
|
13 |
|
14 |
def cleaned_para(input_sentence):
|
15 |
+
p=generator('<s>'+input_sentence+ '</s>>>>><p>',do_sample=True,max_length=len(input_sentence.split(" "))+512,temperature = 0.9,repetition_penalty=1.2)
|
16 |
return p[0]['generated_text'].split('</s>>>>><p>')[1].split('</p>')[0]
|
17 |
|
18 |
from spacy.lang.en import English # updated
|