Nihal Nayak commited on
Commit
a345dc2
1 Parent(s): e179ed9

add: examples and description

Browse files
Files changed (1) hide show
  1. app.py +24 -8
app.py CHANGED
@@ -10,6 +10,7 @@ model = AutoModelForCausalLM.from_pretrained("BatsResearch/bonito-v1")
10
  tokenizer = AutoTokenizer.from_pretrained("BatsResearch/bonito-v1")
11
  model.to("cuda")
12
 
 
13
  @spaces.GPU
14
  def respond(
15
  message,
@@ -46,6 +47,7 @@ def respond(
46
 
47
  return instruction, response
48
 
 
49
  task_types = [
50
  "extractive question answering",
51
  "multiple-choice question answering",
@@ -85,17 +87,33 @@ GitHub: https://github.com/BatsResearch/bonito
85
  """
86
 
87
  examples = [
88
- ("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: Natural language inference"),
89
- ("""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).""", "Yes-no question answering"),
 
 
 
 
 
 
90
  ]
91
 
92
  demo = gr.Interface(
93
  fn=respond,
94
  inputs=[
95
  gr.Textbox(label="Context", lines=5, placeholder="Enter context here.."),
96
- gr.Dropdown(task_types, value="Natural language inference", label="Task type", ),
 
 
 
 
 
 
 
 
 
 
 
97
  ],
98
- outputs=[gr.Textbox(label="Input", lines=5,), gr.Textbox(label="Output")],
99
  additional_inputs=[
100
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
101
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
@@ -108,12 +126,10 @@ demo = gr.Interface(
108
  ),
109
  ],
110
  title="Bonito",
111
- description="A chatbot that uses the Hugging Face Zephyr model.",
112
- examples=[],
113
  )
114
 
115
 
116
-
117
-
118
  if __name__ == "__main__":
119
  demo.launch()
 
10
  tokenizer = AutoTokenizer.from_pretrained("BatsResearch/bonito-v1")
11
  model.to("cuda")
12
 
13
+
14
  @spaces.GPU
15
  def respond(
16
  message,
 
47
 
48
  return instruction, response
49
 
50
+
51
  task_types = [
52
  "extractive question answering",
53
  "multiple-choice question answering",
 
87
  """
88
 
89
  examples = [
90
+ (
91
+ """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:""",
92
+ "Natural language inference",
93
+ ),
94
+ (
95
+ """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).""",
96
+ "Yes-no question answering",
97
+ ),
98
  ]
99
 
100
  demo = gr.Interface(
101
  fn=respond,
102
  inputs=[
103
  gr.Textbox(label="Context", lines=5, placeholder="Enter context here.."),
104
+ gr.Dropdown(
105
+ task_types,
106
+ value="Natural language inference",
107
+ label="Task type",
108
+ ),
109
+ ],
110
+ outputs=[
111
+ gr.Textbox(
112
+ label="Input",
113
+ lines=5,
114
+ ),
115
+ gr.Textbox(label="Output"),
116
  ],
 
117
  additional_inputs=[
118
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
119
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
 
126
  ),
127
  ],
128
  title="Bonito",
129
+ description=description,
130
+ examples=examples,
131
  )
132
 
133
 
 
 
134
  if __name__ == "__main__":
135
  demo.launch()