Update app.py
Browse files
app.py
CHANGED
@@ -125,7 +125,7 @@ def CTXGen(Ο, g_num, length_range, model_name, seed):
|
|
125 |
cls_probability = cls_probability[0].item()
|
126 |
act_probability = act_probability[0].item()
|
127 |
generated_seq = generated_seq[generated_seq.index('[MASK]') + 2:generated_seq.index('[SEP]')]
|
128 |
-
|
129 |
if generated_seq.count('C') % 2 == 0 and len("".join(generated_seq)) == gen_len:
|
130 |
generated_seqs.append("".join(generated_seq))
|
131 |
if "".join(generated_seq) not in train_seq and "".join(generated_seq) not in generated_seqs[0:-1] and all(x not in NON_AA for x in generated_seq):
|
@@ -156,11 +156,11 @@ with gr.Blocks() as demo:
|
|
156 |
gr.Markdown("π **[Optimization Generation](https://huggingface.co/spaces/oucgc1996/CTXGen_optimization_generation)**")
|
157 |
gr.Markdown("# Conotoxin Unconstrained Generation")
|
158 |
gr.Markdown("#### Input")
|
159 |
-
gr.Markdown("β
**Ο**: temperature factor controls the diversity of conotoxins generated. The higher the value, the higher the diversity")
|
160 |
gr.Markdown("β
**Number of generations**: if it is not completed within 1200 seconds, it will automatically stop.")
|
161 |
-
gr.Markdown("β
**Length range**: expected length range of conotoxins generated")
|
162 |
gr.Markdown("β
**Model**: model parameters trained at different stages of data augmentation. Please refer to the paper for details.")
|
163 |
-
gr.Markdown("β
**Seed**:
|
164 |
with gr.Row():
|
165 |
Ο = gr.Slider(minimum=1, maximum=2, step=0.1, label="Ο")
|
166 |
g_num = gr.Dropdown(choices=[1, 10, 20, 30, 40, 50], label="Number of generations")
|
|
|
125 |
cls_probability = cls_probability[0].item()
|
126 |
act_probability = act_probability[0].item()
|
127 |
generated_seq = generated_seq[generated_seq.index('[MASK]') + 2:generated_seq.index('[SEP]')]
|
128 |
+
|
129 |
if generated_seq.count('C') % 2 == 0 and len("".join(generated_seq)) == gen_len:
|
130 |
generated_seqs.append("".join(generated_seq))
|
131 |
if "".join(generated_seq) not in train_seq and "".join(generated_seq) not in generated_seqs[0:-1] and all(x not in NON_AA for x in generated_seq):
|
|
|
156 |
gr.Markdown("π **[Optimization Generation](https://huggingface.co/spaces/oucgc1996/CTXGen_optimization_generation)**")
|
157 |
gr.Markdown("# Conotoxin Unconstrained Generation")
|
158 |
gr.Markdown("#### Input")
|
159 |
+
gr.Markdown("β
**Ο**: temperature factor controls the diversity of conotoxins generated. The higher the value, the higher the diversity.")
|
160 |
gr.Markdown("β
**Number of generations**: if it is not completed within 1200 seconds, it will automatically stop.")
|
161 |
+
gr.Markdown("β
**Length range**: expected length range of conotoxins generated.")
|
162 |
gr.Markdown("β
**Model**: model parameters trained at different stages of data augmentation. Please refer to the paper for details.")
|
163 |
+
gr.Markdown("β
**Seed**: enter an integer as the random seed to ensure reproducible results. The default is random.")
|
164 |
with gr.Row():
|
165 |
Ο = gr.Slider(minimum=1, maximum=2, step=0.1, label="Ο")
|
166 |
g_num = gr.Dropdown(choices=[1, 10, 20, 30, 40, 50], label="Number of generations")
|