kz209 commited on
Commit
54c6336
·
1 Parent(s): 6b6861a
pages/summarization_playground.py CHANGED
@@ -61,7 +61,7 @@ def process_input(input_text, model_selection, prompt):
61
  def update_input(example):
62
  if example == random_label:
63
  datapoint = random.choice(dataset)
64
- return datapoint['section_text'] + '\n\nDialogue:' + datapoint['dialogue']
65
  return examples[example]
66
 
67
  def create_summarization_interface():
@@ -73,8 +73,8 @@ def create_summarization_interface():
73
  model_dropdown = gr.Dropdown(choices=Model.__model_list__, label="Choose a model", value=Model.__model_list__[0])
74
 
75
  Template_text = gr.Textbox(value="""Summarize the following dialogue""", label='Input Prompting Template', lines=8, placeholder='Input your prompts')
76
-
77
- input_text = gr.Textbox(label="Input Dialogue", lines=10, placeholder="Enter text here...", value=random.choice(dataset)['dialogue'])
78
  submit_button = gr.Button("✨ Submit ✨")
79
  output = gr.Markdown()
80
 
 
61
  def update_input(example):
62
  if example == random_label:
63
  datapoint = random.choice(dataset)
64
+ return datapoint['section_text'] + '\n\nDialogue:\n' + datapoint['dialogue']
65
  return examples[example]
66
 
67
  def create_summarization_interface():
 
73
  model_dropdown = gr.Dropdown(choices=Model.__model_list__, label="Choose a model", value=Model.__model_list__[0])
74
 
75
  Template_text = gr.Textbox(value="""Summarize the following dialogue""", label='Input Prompting Template', lines=8, placeholder='Input your prompts')
76
+ datapoint = random.choice(dataset)
77
+ input_text = gr.Textbox(label="Input Dialogue", lines=10, placeholder="Enter text here...", value=datapoint['section_text'] + '\n\nDialogue:\n' + datapoint['dialogue'])
78
  submit_button = gr.Button("✨ Submit ✨")
79
  output = gr.Markdown()
80
 
utils/model.py CHANGED
@@ -55,7 +55,6 @@ class Model(torch.nn.Module):
55
  temperature=temp,
56
  num_return_sequences=1,
57
  eos_token_id=self.tokenizer.eos_token_id,
58
- return_full_text=False
59
  )
60
 
61
  return sequences[-1]['generated_text']
 
55
  temperature=temp,
56
  num_return_sequences=1,
57
  eos_token_id=self.tokenizer.eos_token_id,
 
58
  )
59
 
60
  return sequences[-1]['generated_text']