Nihal Nayak commited on
Commit
73c0033
1 Parent(s): 3e5dccf

fix: examples

Browse files
Files changed (1) hide show
  1. app.py +16 -11
app.py CHANGED
@@ -69,33 +69,35 @@ 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
- (
84
- """2.3 Provided that the Recipient has a written agreement with the following persons or entities requiring them to treat the Confidential Information in accordance with this Agreement, the Recipient may disclose the Confidential Information to: 2.3.1 Any other party with the Discloser's prior written consent; and 2.3.2 the Recipient's employees, officials, representatives and agents who have a strict need to know the contents of the Confidential Information, and employees, officials, representatives and agents of any legal entity that it controls, controls it, or with which it is under common control, who have a similar need to know the contents of the Confidential Information, provided that, for these purposes a controlled legal entity means:""",
85
- """Chronic rhinosinusitis (CRS) is a heterogeneous disease with an uncertain pathogenesis. Group 2 innate lymphoid cells (ILC2s) represent a recently discovered cell population which has been implicated in driving Th2 inflammation in CRS; however, their relationship with clinical disease characteristics has yet to be investigated. The aim of this study was to identify ILC2s in sinus mucosa in patients with CRS and controls and compare ILC2s across characteristics of disease. A cross-sectional study of patients with CRS undergoing endoscopic sinus surgery was conducted. Sinus mucosal biopsies were obtained during surgery and control tissue from patients undergoing pituitary tumour resection through transphenoidal approach. ILC2s were identified as CD45(+) Lin(-) CD127(+) CD4(-) CD8(-) CRTH2(CD294)(+) CD161(+) cells in single cell suspensions through flow cytometry. ILC2 frequencies, measured as a percentage of CD45(+) cells, were compared across CRS phenotype, endotype, inflammatory CRS subtype and other disease characteristics including blood eosinophils, serum IgE, asthma status and nasal symptom score. 35 patients (40% female, age 48 ± 17 years) including 13 with eosinophilic CRS (eCRS), 13 with non-eCRS and 9 controls were recruited. ILC2 frequencies were associated with the presence of nasal polyps (P = 0.002) as well as high tissue eosinophilia (P = 0.004) and eosinophil-dominant CRS (P = 0.001) (Mann-Whitney U). They were also associated with increased blood eosinophilia (P = 0.005). There were no significant associations found between ILC2s and serum total IgE and allergic disease. In the CRS with nasal polyps (CRSwNP) population, ILC2s were increased in patients with co-existing asthma (P = 0.03). ILC2s were also correlated with worsening nasal symptom score in CRS (P = 0.04).""",
86
  ),
87
  (
88
- "Natural language inference",
89
  "Yes-no question answering",
90
  ),
91
- ]]
 
 
 
 
92
 
93
- example_context = """2.3 Provided that the Recipient has a written agreement with the following persons or entities requiring them to treat the Confidential Information in accordance with this Agreement, the Recipient may disclose the Confidential Information to: 2.3.1 Any other party with the Discloser's prior written consent; and 2.3.2 the Recipient's employees, officials, representatives and agents who have a strict need to know the contents of the Confidential Information, and employees, officials, representatives and agents of any legal entity that it controls, controls it, or with which it is under common control, who have a similar need to know the contents of the Confidential Information, provided that, for these purposes a controlled legal entity means:"""
94
 
95
  demo = gr.Interface(
96
  fn=respond,
97
  inputs=[
98
- gr.Textbox(label="Context", lines=5, placeholder="Enter context here..", value=example_context),
99
  gr.Dropdown(
100
  task_types,
101
  value="Natural language inference",
@@ -122,8 +124,11 @@ demo = gr.Interface(
122
  ],
123
  title="Bonito",
124
  description=description,
 
125
  )
126
 
127
 
128
  if __name__ == "__main__":
129
  demo.launch()
 
 
 
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
  ),
86
  (
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], 512, 0.7, 0.95) 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",
 
124
  ],
125
  title="Bonito",
126
  description=description,
127
+ examples=examples_with_additional,
128
  )
129
 
130
 
131
  if __name__ == "__main__":
132
  demo.launch()
133
+
134
+