research14 commited on
Commit
cc5a0c8
·
1 Parent(s): c91e5a1

edited responses

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -113,7 +113,7 @@ task_options = ['POS', 'Chunking', 'Parsing']
113
 
114
  # Function to process text based on model and task
115
  def process_text(model_name, task, text):
116
- gid_list = selected_idx[0:10]
117
 
118
  for gid in tqdm(gid_list, desc='Query'):
119
  text = ptb[gid]['text']
@@ -123,7 +123,12 @@ def process_text(model_name, task, text):
123
  strategy2 = task_prompts[task]['strategy2'].format(text)
124
  strategy3 = task_prompts[task]['strategy3'].format(text)
125
 
126
- return tuple(pipelines[model_name](strategy) for strategy in [strategy1, strategy2, strategy3])
 
 
 
 
 
127
 
128
  # Gradio interface
129
  iface = gr.Interface(
 
113
 
114
  # Function to process text based on model and task
115
  def process_text(model_name, task, text):
116
+ gid_list = selected_idx[0:20]
117
 
118
  for gid in tqdm(gid_list, desc='Query'):
119
  text = ptb[gid]['text']
 
123
  strategy2 = task_prompts[task]['strategy2'].format(text)
124
  strategy3 = task_prompts[task]['strategy3'].format(text)
125
 
126
+ # Extract generated text from the model's response
127
+ response1 = pipelines[model_name](strategy1)[0]['generated_text']
128
+ response2 = pipelines[model_name](strategy2)[0]['generated_text']
129
+ response3 = pipelines[model_name](strategy3)[0]['generated_text']
130
+
131
+ return response1, response2, response3
132
 
133
  # Gradio interface
134
  iface = gr.Interface(