Nihal Nayak commited on
Commit
899d9e5
1 Parent(s): 6ec09af

misc edits

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -63,23 +63,22 @@ task_types = [
63
  "natural language inference",
64
  ]
65
  # capitalize for better readability
66
- task_types = [task_type.capitalize() for task_type in task_types]
67
 
68
  description = """
69
  This is a demo for Bonito, an open-source model for conditional task generation: the task of converting unannotated text into task-specific synthetic instruction tuning data.
70
 
71
  ### More details on Bonito
72
- - Model: https://huggingface.co/BatsResearch/bonito-v1
73
-
74
  - Paper: https://arxiv.org/abs/2402.18334
75
-
76
  - GitHub: https://github.com/BatsResearch/bonito
77
 
78
  ### Instructions
79
  Try out the model by entering a context and selecting a task type from the dropdown. The model will generate a task instruction based on the context and task type you provide.
80
  """
81
 
82
- examples = [(
 
83
  """Providence was one of the first cities in the country to industrialize and became noted for its textile manufacturing and subsequent machine tool, jewelry, and silverware industries. Today, the city of Providence is home to eight hospitals and eight institutions of higher learning which have shifted the city's economy into service industries, though it still retains some manufacturing activity.""",
84
  "Natural language inference",
85
  ),
@@ -87,21 +86,23 @@ examples = [(
87
  """John Wick (Keanu Reeves) uncovers a path to defeating The High Table. But before he can earn his freedom, Wick must face off against a new enemy with powerful alliances across the globe and forces that turn old friends into foes.""",
88
  "Yes-no question answering",
89
  ),
 
 
 
 
90
  ]
91
 
92
- examples_with_additional = [
93
- [x[0], x[1]] for x in examples
94
- ]
95
 
96
 
97
  demo = gr.Interface(
98
  fn=respond,
99
  inputs=[
100
- gr.Textbox(label="Context", lines=5, placeholder="Enter context here.."),
101
  gr.Dropdown(
102
  task_types,
103
  value="Natural language inference",
104
- label="Task type",
105
  ),
106
  ],
107
  outputs=[
@@ -130,5 +131,3 @@ demo = gr.Interface(
130
 
131
  if __name__ == "__main__":
132
  demo.launch()
133
-
134
-
 
63
  "natural language inference",
64
  ]
65
  # capitalize for better readability
66
+ task_types = [task_type.title() for task_type in task_types]
67
 
68
  description = """
69
  This is a demo for Bonito, an open-source model for conditional task generation: the task of converting unannotated text into task-specific synthetic instruction tuning data.
70
 
71
  ### More details on Bonito
72
+ - Model: https://huggingface.co/BatsResearch/bonito-v
 
73
  - Paper: https://arxiv.org/abs/2402.18334
 
74
  - GitHub: https://github.com/BatsResearch/bonito
75
 
76
  ### Instructions
77
  Try out the model by entering a context and selecting a task type from the dropdown. The model will generate a task instruction based on the context and task type you provide.
78
  """
79
 
80
+ examples = [
81
+ (
82
  """Providence was one of the first cities in the country to industrialize and became noted for its textile manufacturing and subsequent machine tool, jewelry, and silverware industries. Today, the city of Providence is home to eight hospitals and eight institutions of higher learning which have shifted the city's economy into service industries, though it still retains some manufacturing activity.""",
83
  "Natural language inference",
84
  ),
 
86
  """John Wick (Keanu Reeves) uncovers a path to defeating The High Table. But before he can earn his freedom, Wick must face off against a new enemy with powerful alliances across the globe and forces that turn old friends into foes.""",
87
  "Yes-no question answering",
88
  ),
89
+ (
90
+ """In 2013, American singer-songwriter Taylor Swift purchased High Watch for US$17.75 million. From 2013 to 2016, she received widespread press coverage for hosting annual American Independence Day parties on the estate, featuring numerous celebrity guests and lavish decorations often depicted on Instagram.""",
91
+ "Extractive question answering",
92
+ ),
93
  ]
94
 
95
+ examples_with_additional = [[x[0], x[1]] for x in examples]
 
 
96
 
97
 
98
  demo = gr.Interface(
99
  fn=respond,
100
  inputs=[
101
+ gr.Textbox(label="Passage", lines=5, placeholder="Enter context here.."),
102
  gr.Dropdown(
103
  task_types,
104
  value="Natural language inference",
105
+ label="Task Type",
106
  ),
107
  ],
108
  outputs=[
 
131
 
132
  if __name__ == "__main__":
133
  demo.launch()