geonmo.gu commited on
Commit
248a504
β€’
1 Parent(s): 4b145c8

refine generated text

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -194,7 +194,7 @@ def generate_captions(prompt, num_captions=3):
194
  for _ in range(num_captions):
195
  response = requests.post(API_URL, headers=headers, json=payload)
196
  output = response.json()
197
- generated_text = output[0]['generated_text'].replace(prompt, '')
198
  bloom_results.append(generated_text)
199
  return bloom_results
200
 
 
194
  for _ in range(num_captions):
195
  response = requests.post(API_URL, headers=headers, json=payload)
196
  output = response.json()
197
+ generated_text = output[0]['generated_text'].replace(prompt, '').split('.')[0] + '.'
198
  bloom_results.append(generated_text)
199
  return bloom_results
200