nttwt1597 commited on
Commit
f2e901b
·
verified ·
1 Parent(s): d678393

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -76,12 +76,12 @@ def run_model_on_text(text):
76
  prompt = format_prompt(text)
77
  inputs = tokenizer(prompt, return_tensors='pt')
78
 
79
- # prompt is a new string stored in memory not cuda.
80
  # inputs = inputs.to(device)
81
 
82
  streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
83
 
84
- generation_kwargs = dict(inputs, streamer=streamer,eos_token_id=terminators, max_new_tokens=1024, do_sample=True, repetition_penalty=1.2,)
85
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
86
  thread.start()
87
 
@@ -90,7 +90,7 @@ def run_model_on_text(text):
90
  generated_text += new_text
91
  yield generated_text
92
 
93
- place_holder = f""""Study Objectives
94
  Optical diagnosis of colorectal polyps is a promising tool to avoid risks of unnecessary polypectomies and to save costs of tissue pathology. NICE (NBI International Colorectal Endoscopic) and WASP (Workgroup on Serrated Polyps and Polyposis) classification were developed for diagnosis of adenomatous and sessile serrated polyps, respectively.
95
 
96
  Near-focus (NF) narrow-band imaging (NBI) is an image-magnifying technology which enables optical magnification of up to 65x in near focus (NF) compared with 52x in normal standard focus (SF) with the simple push of a button of the endoscope to be interchangeable between NF and SF. There were few studies comparing diagnostic accuracy between NF and SF in the diagnosis of colorectal polyps. So, our aim of the current study is to compare accuracy of NF NBI compared with SF NBI in the optical diagnosis of neoplastic and non-neoplastic polyp and the accuracy of NF NBI versus SF NBI in distinguishing serrated adenoma from hyperplastic polyp in sessile lesions using histologic evaluation as the gold standard.
@@ -112,9 +112,9 @@ Primary Purpose: Diagnostic
112
  Allocation: Randomized
113
  Interventional Model: Parallel Assignment
114
  Masking: None (Open Label)
115
- """"
116
 
117
- prefilled_value = """"Study Objectives
118
  [Brief Summary] and/or [Detailed Description]
119
 
120
  Conditions
@@ -129,7 +129,7 @@ Phase
129
  Primary Purpose
130
  Allocation
131
  Interventional Model
132
- Masking""""
133
 
134
  prompt_box = gr.Textbox(
135
  lines=25,
@@ -150,4 +150,4 @@ demo = gr.Interface(
150
  allow_flagging='auto',
151
  )
152
 
153
- demo.queue(max_size=200).launch(share=True ,debug=True)
 
76
  prompt = format_prompt(text)
77
  inputs = tokenizer(prompt, return_tensors='pt')
78
 
79
+ # prompt is a new string stored in memory is not cuda.
80
  # inputs = inputs.to(device)
81
 
82
  streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
83
 
84
+ generation_kwargs = dict(inputs, streamer=streamer,eos_token_id=terminators, max_new_tokens=1024, do_sample=True, repetition_penalty=1.8,)
85
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
86
  thread.start()
87
 
 
90
  generated_text += new_text
91
  yield generated_text
92
 
93
+ place_holder = f"""Study Objectives
94
  Optical diagnosis of colorectal polyps is a promising tool to avoid risks of unnecessary polypectomies and to save costs of tissue pathology. NICE (NBI International Colorectal Endoscopic) and WASP (Workgroup on Serrated Polyps and Polyposis) classification were developed for diagnosis of adenomatous and sessile serrated polyps, respectively.
95
 
96
  Near-focus (NF) narrow-band imaging (NBI) is an image-magnifying technology which enables optical magnification of up to 65x in near focus (NF) compared with 52x in normal standard focus (SF) with the simple push of a button of the endoscope to be interchangeable between NF and SF. There were few studies comparing diagnostic accuracy between NF and SF in the diagnosis of colorectal polyps. So, our aim of the current study is to compare accuracy of NF NBI compared with SF NBI in the optical diagnosis of neoplastic and non-neoplastic polyp and the accuracy of NF NBI versus SF NBI in distinguishing serrated adenoma from hyperplastic polyp in sessile lesions using histologic evaluation as the gold standard.
 
112
  Allocation: Randomized
113
  Interventional Model: Parallel Assignment
114
  Masking: None (Open Label)
115
+ """
116
 
117
+ prefilled_value = """Study Objectives
118
  [Brief Summary] and/or [Detailed Description]
119
 
120
  Conditions
 
129
  Primary Purpose
130
  Allocation
131
  Interventional Model
132
+ Masking"""
133
 
134
  prompt_box = gr.Textbox(
135
  lines=25,
 
150
  allow_flagging='auto',
151
  )
152
 
153
+ demo.queue(max_size=20).launch(debug=True) #share=True