kz209 commited on
Commit
a232b31
1 Parent(s): c89910e
pages/summarization_playground.py CHANGED
@@ -56,9 +56,9 @@ def get_model_batch_generation(model_name):
56
  def generate_answer(sources, model_name, prompt):
57
  model_device_check(model_name)
58
 
59
- content = [prompt + '\n{' + sources + '}\n\nsummary:']
60
 
61
- answer = model[model_name].gen(content)
62
 
63
  return answer
64
 
 
56
  def generate_answer(sources, model_name, prompt):
57
  model_device_check(model_name)
58
 
59
+ content = prompt + '\n{' + sources + '}\n\nsummary:'
60
 
61
+ answer = model[model_name].gen(content).strip()
62
 
63
  return answer
64
 
utils/multiple_stream.py CHANGED
@@ -27,7 +27,7 @@ def stream_data(content_list, model):
27
 
28
  try:
29
  id, word = next(generator) # Get the next generated word for the corresponding content
30
- outputs[id] += f" {word}"
31
  updated = True
32
  except StopIteration:
33
  break
 
27
 
28
  try:
29
  id, word = next(generator) # Get the next generated word for the corresponding content
30
+ outputs[id] += f"{word} "
31
  updated = True
32
  except StopIteration:
33
  break