devendergarg14 commited on
Commit
e8da33e
·
1 Parent(s): 48514dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -10,7 +10,7 @@ def query(input_sentence,num,start):
10
  for i in range(0,num):
11
  intial="""These are the few examples of converting original sentences into paraphrased sentences.\n original: The gray clouds were a warning of an approaching storm.\n paraphrase: The coming storm was foretold by the dark clouds.\n original: Giraffes like Acacia leaves and hay, and they can consume 75 pounds of food a day.\n paraphrase: A giraffe can eat up to 75 pounds of Acacia leaves and hay daily.\n """
12
  full_input=intial+"original:"+input_sentence + "\n paraphrase:"+start
13
- data = json.dumps({"inputs":full_input,"options":{"wait_for_model":1},"parameters":{"max_length":len(full_input.split())+80,"min_length":len(full_input.split())+80},"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_text=output.split('paraphrase:',3)[-1]
 
10
  for i in range(0,num):
11
  intial="""These are the few examples of converting original sentences into paraphrased sentences.\n original: The gray clouds were a warning of an approaching storm.\n paraphrase: The coming storm was foretold by the dark clouds.\n original: Giraffes like Acacia leaves and hay, and they can consume 75 pounds of food a day.\n paraphrase: A giraffe can eat up to 75 pounds of Acacia leaves and hay daily.\n """
12
  full_input=intial+"original:"+input_sentence + "\n paraphrase:"+start
13
+ data = json.dumps({"inputs":full_input,"parameters":{"max_length":len(full_input.split())+80,"min_length":len(full_input.split())+80},"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_text=output.split('paraphrase:',3)[-1]