Commit
·
63b58e5
1
Parent(s):
5bd5e0b
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,8 @@ def query(input_sentence,num,start):
|
|
13 |
data = json.dumps({"inputs":full_input,"parameters":{"max_length":len(full_input.split())+70,"min_length":len(full_input.split())+70},"temperature":0.65+0.05*i})
|
14 |
response = requests.request("POST", API_URL, headers=headers, data=data)
|
15 |
output=json.loads(response.content.decode("utf-8"))[0]['generated_text']
|
16 |
-
|
|
|
17 |
paraphrase_final.append( paraphrase_text.split('.',1)[0]+".")
|
18 |
return '\n\n'.join([i for i in paraphrase_final[0:]])
|
19 |
title = "Paraphrasing with GPT-NEO"
|
@@ -28,5 +29,4 @@ title=title,description=description,
|
|
28 |
article= article,
|
29 |
examples=examples,
|
30 |
allow_screenshot=False,
|
31 |
-
allow_flagging=False
|
32 |
-
enable_queue=True).launch()
|
|
|
13 |
data = json.dumps({"inputs":full_input,"parameters":{"max_length":len(full_input.split())+70,"min_length":len(full_input.split())+70},"temperature":0.65+0.05*i})
|
14 |
response = requests.request("POST", API_URL, headers=headers, data=data)
|
15 |
output=json.loads(response.content.decode("utf-8"))[0]['generated_text']
|
16 |
+
paraphrase=output.split('paraphrase:',3)[-1]
|
17 |
+
paraphrase_text=paraphrase.split('original:',1)[0]
|
18 |
paraphrase_final.append( paraphrase_text.split('.',1)[0]+".")
|
19 |
return '\n\n'.join([i for i in paraphrase_final[0:]])
|
20 |
title = "Paraphrasing with GPT-NEO"
|
|
|
29 |
article= article,
|
30 |
examples=examples,
|
31 |
allow_screenshot=False,
|
32 |
+
allow_flagging=False).launch(enable_queue=True)
|
|