Nihal Nayak commited on
Commit
c35893e
1 Parent(s): 4d92f8a

instruction

Browse files
Files changed (1) hide show
  1. app.py +28 -3
app.py CHANGED
@@ -67,11 +67,33 @@ task_types = [
67
  # capitalize for better readability
68
  task_types = [task_type.capitalize() for task_type in task_types]
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  demo = gr.Interface(
71
  fn=respond,
72
  inputs=[
73
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
74
- gr.Dropdown(task_types, label="Task type"),
75
  ],
76
  outputs=[gr.Textbox(label="Input"), gr.Textbox(label="Output")],
77
  additional_inputs=[
@@ -85,10 +107,13 @@ demo = gr.Interface(
85
  label="Top-p (nucleus sampling)",
86
  ),
87
  ],
88
- title="Zephyr Chatbot",
89
  description="A chatbot that uses the Hugging Face Zephyr model.",
 
90
  )
91
 
92
 
 
 
93
  if __name__ == "__main__":
94
  demo.launch()
 
67
  # capitalize for better readability
68
  task_types = [task_type.capitalize() for task_type in task_types]
69
 
70
+ description = """
71
+ ## Bonito
72
+ This is a demo for Bonito, an open-source model for conditional task generation that can generate synthetic instruction tuning datasets for a wide range of NLP tasks.
73
+
74
+ ## Instructions
75
+ 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.
76
+
77
+ ## More details
78
+ Model: https://huggingface.co/BatsResearch/bonito-v1
79
+
80
+ Paper: https://arxiv.org/abs/2402.18334
81
+
82
+ GitHub: https://github.com/BatsResearch/bonito
83
+
84
+
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:"
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)."""
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"), gr.Textbox(label="Output")],
99
  additional_inputs=[
 
107
  label="Top-p (nucleus sampling)",
108
  ),
109
  ],
110
+ title="Bonito",
111
  description="A chatbot that uses the Hugging Face Zephyr model.",
112
+ examples=examples,
113
  )
114
 
115
 
116
+
117
+
118
  if __name__ == "__main__":
119
  demo.launch()