aiqcamp commited on
Commit
cebc63d
ยท
verified ยท
1 Parent(s): bcfc971

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +62 -27
app.py CHANGED
@@ -622,6 +622,9 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
622
  # ์ƒ์„ฑ ๋ฒ„ํŠผ
623
  create_btn = gr.Button("๐Ÿงฌ ํžˆ์–ด๋กœ ์ƒ์„ฑ!", variant="primary", scale=2)
624
 
 
 
 
625
  with gr.TabItem("๐Ÿงฌ ํžˆ์–ด๋กœ DNA ์„ค๊ณ„"):
626
  gr.Markdown("""
627
  ### ๐Ÿงช ํžˆ์–ด๋กœ DNA ๊ณ ๊ธ‰ ์„ค์ •
@@ -683,10 +686,6 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
683
  label="๊ณ ๋ฆฌํ˜• ๊ตฌ์กฐ ๋น„์œจ",
684
  visible=True
685
  )
686
-
687
-
688
- design_btn = gr.Button("๐Ÿงฌ DNA ์„ค๊ณ„ ์ƒ์„ฑ!", variant="primary", scale=2)
689
-
690
 
691
  # ์•„๋ฏธ๋…ธ์‚ฐ ๊ตฌ์„ฑ ์„ค์ • ์ถ”๊ฐ€
692
  with gr.Accordion(label='๐Ÿงฌ DNA ๊ตฌ์„ฑ ์„ค์ •', open=False):
@@ -740,6 +739,10 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
740
  label='๋…ธ์ด์ฆˆ ํƒ€์ž…',
741
  value='normal'
742
  )
 
 
 
 
743
 
744
  with gr.TabItem("๐Ÿงช ํžˆ์–ด๋กœ ์œ ์ „์ž ๊ฐ•ํ™”"):
745
  gr.Markdown("""
@@ -776,11 +779,8 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
776
  preview_viewer = gr.HTML()
777
  rewrite_pdb = gr.File(label='ํžˆ์–ด๋กœ DNA ํŒŒ์ผ')
778
  preview_btn = gr.Button("๐Ÿ” ๋ฏธ๋ฆฌ๋ณด๊ธฐ", variant="secondary")
 
779
 
780
-
781
- enhance_btn = gr.Button("โšก ๊ฐ•ํ™”๋œ ํžˆ์–ด๋กœ ์ƒ์„ฑ!", variant="primary", scale=2)
782
-
783
-
784
  with gr.TabItem("๐Ÿ‘‘ ํžˆ์–ด๋กœ ๊ฐ€๋ฌธ"):
785
  gr.Markdown("""
786
  ### ๐Ÿฐ ์œ„๋Œ€ํ•œ ํžˆ์–ด๋กœ ๊ฐ€๋ฌธ์˜ ์œ ์‚ฐ
@@ -798,12 +798,12 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
798
  pssm = gr.File(label='๋ถ„์„๋œ ๊ฐ€๋ฌธ ํŠน์„ฑ')
799
  pssm_view = gr.Plot(label='๊ฐ€๋ฌธ ํŠน์„ฑ ๋ถ„์„ ๊ฒฐ๊ณผ')
800
  pssm_gen_btn = gr.Button("โœจ ๊ฐ€๋ฌธ ํŠน์„ฑ ๋ถ„์„", variant="secondary")
 
 
801
 
802
- inherit_btn = gr.Button("๐Ÿ‘‘ ๊ฐ€๋ฌธ์˜ ํž˜ ๊ณ„์Šน!", variant="primary", scale=2)
803
 
804
 
805
 
806
-
807
  with gr.Column():
808
  gr.Markdown("## ๐Ÿฆธโ€โ™‚๏ธ ํžˆ์–ด๋กœ ํ”„๋กœํ•„")
809
 
@@ -823,7 +823,7 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
823
  gr.Markdown("#### ๐Ÿ”ฌ DNA ๊ตฌ์กฐ")
824
  output_viewer = gr.HTML()
825
 
826
- # ์ด๋ฒคํŠธ ์—ฐ๊ฒฐ ๋ถ€๋ถ„์— ๋‹ค์Œ ์ฝ”๋“œ ์ถ”๊ฐ€
827
  seq_opt.change(
828
  fn=toggle_seq_input,
829
  inputs=[seq_opt],
@@ -838,33 +838,68 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
838
  queue=False
839
  )
840
 
841
-
842
-
843
- # ์ด๋ฒคํŠธ ์—ฐ๊ฒฐ
844
  preview_btn.click(get_motif_preview,[pdb_id_code, contigs],[preview_viewer, rewrite_pdb])
845
  pssm_gen_btn.click(get_pssm,[fasta_msa,input_pssm],[pssm_view, pssm])
846
 
847
- # ๊ฐ ํƒญ์˜ ์ƒ์„ฑ ๋ฒ„ํŠผ ์—ฐ๊ฒฐ
848
- design_btn.click(
849
  combined_generation,
850
- inputs=[...], # DNA ์„ค๊ณ„์— ํ•„์š”ํ•œ ์ž…๋ ฅ๊ฐ’๋“ค
851
- outputs=[...] # ํ•„์š”ํ•œ ์ถœ๋ ฅ๊ฐ’๋“ค
 
 
 
 
 
 
 
 
 
 
 
 
 
852
  )
853
 
854
- enhance_btn.click(
855
  combined_generation,
856
- inputs=[...], # ์œ ์ „์ž ๊ฐ•ํ™”์— ํ•„์š”ํ•œ ์ž…๋ ฅ๊ฐ’๋“ค
857
- outputs=[...] # ํ•„์š”ํ•œ ์ถœ๋ ฅ๊ฐ’๋“ค
 
 
 
 
 
 
 
 
 
 
 
 
 
858
  )
859
 
860
- inherit_btn.click(
861
  combined_generation,
862
- inputs=[...], # ๊ฐ€๋ฌธ ๊ณ„์Šน์— ํ•„์š”ํ•œ ์ž…๋ ฅ๊ฐ’๋“ค
863
- outputs=[...] # ํ•„์š”ํ•œ ์ถœ๋ ฅ๊ฐ’๋“ค
 
 
 
 
 
 
 
 
 
 
 
 
 
864
  )
865
 
866
- # generate_hero์™€ protein_diffusion_model์„ combined_generation์œผ๋กœ ํ†ตํ•ฉ
867
- create_btn.click(
868
  combined_generation,
869
  inputs=[
870
  hero_name, strength, flexibility, speed, defense, hero_size, special_ability,
@@ -884,4 +919,4 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
884
  )
885
 
886
  demo.queue()
887
- demo.launch(debug=True)
 
622
  # ์ƒ์„ฑ ๋ฒ„ํŠผ
623
  create_btn = gr.Button("๐Ÿงฌ ํžˆ์–ด๋กœ ์ƒ์„ฑ!", variant="primary", scale=2)
624
 
625
+
626
+
627
+
628
  with gr.TabItem("๐Ÿงฌ ํžˆ์–ด๋กœ DNA ์„ค๊ณ„"):
629
  gr.Markdown("""
630
  ### ๐Ÿงช ํžˆ์–ด๋กœ DNA ๊ณ ๊ธ‰ ์„ค์ •
 
686
  label="๊ณ ๋ฆฌํ˜• ๊ตฌ์กฐ ๋น„์œจ",
687
  visible=True
688
  )
 
 
 
 
689
 
690
  # ์•„๋ฏธ๋…ธ์‚ฐ ๊ตฌ์„ฑ ์„ค์ • ์ถ”๊ฐ€
691
  with gr.Accordion(label='๐Ÿงฌ DNA ๊ตฌ์„ฑ ์„ค์ •', open=False):
 
739
  label='๋…ธ์ด์ฆˆ ํƒ€์ž…',
740
  value='normal'
741
  )
742
+
743
+ design_btn = gr.Button("๐Ÿงฌ DNA ์„ค๊ณ„ ์ƒ์„ฑ!", variant="primary", scale=2)
744
+
745
+
746
 
747
  with gr.TabItem("๐Ÿงช ํžˆ์–ด๋กœ ์œ ์ „์ž ๊ฐ•ํ™”"):
748
  gr.Markdown("""
 
779
  preview_viewer = gr.HTML()
780
  rewrite_pdb = gr.File(label='ํžˆ์–ด๋กœ DNA ํŒŒ์ผ')
781
  preview_btn = gr.Button("๐Ÿ” ๋ฏธ๋ฆฌ๋ณด๊ธฐ", variant="secondary")
782
+ enhance_btn = gr.Button("โšก ๊ฐ•ํ™”๋œ ํžˆ์–ด๋กœ ์ƒ์„ฑ!", variant="primary", scale=2)
783
 
 
 
 
 
784
  with gr.TabItem("๐Ÿ‘‘ ํžˆ์–ด๋กœ ๊ฐ€๋ฌธ"):
785
  gr.Markdown("""
786
  ### ๐Ÿฐ ์œ„๋Œ€ํ•œ ํžˆ์–ด๋กœ ๊ฐ€๋ฌธ์˜ ์œ ์‚ฐ
 
798
  pssm = gr.File(label='๋ถ„์„๋œ ๊ฐ€๋ฌธ ํŠน์„ฑ')
799
  pssm_view = gr.Plot(label='๊ฐ€๋ฌธ ํŠน์„ฑ ๋ถ„์„ ๊ฒฐ๊ณผ')
800
  pssm_gen_btn = gr.Button("โœจ ๊ฐ€๋ฌธ ํŠน์„ฑ ๋ถ„์„", variant="secondary")
801
+ inherit_btn = gr.Button("๐Ÿ‘‘ ๊ฐ€๋ฌธ์˜ ํž˜ ๊ณ„์Šน!", variant="primary", scale=2)
802
+
803
 
 
804
 
805
 
806
 
 
807
  with gr.Column():
808
  gr.Markdown("## ๐Ÿฆธโ€โ™‚๏ธ ํžˆ์–ด๋กœ ํ”„๋กœํ•„")
809
 
 
823
  gr.Markdown("#### ๐Ÿ”ฌ DNA ๊ตฌ์กฐ")
824
  output_viewer = gr.HTML()
825
 
826
+ # ์ด๋ฒคํŠธ ์—ฐ๊ฒฐ
827
  seq_opt.change(
828
  fn=toggle_seq_input,
829
  inputs=[seq_opt],
 
838
  queue=False
839
  )
840
 
 
 
 
841
  preview_btn.click(get_motif_preview,[pdb_id_code, contigs],[preview_viewer, rewrite_pdb])
842
  pssm_gen_btn.click(get_pssm,[fasta_msa,input_pssm],[pssm_view, pssm])
843
 
844
+ # ๊ฐ ํƒญ์˜ ์ƒ์„ฑ ๋ฒ„ํŠผ ์—ฐ๊ฒฐ
845
+ create_btn.click(
846
  combined_generation,
847
+ inputs=[
848
+ hero_name, strength, flexibility, speed, defense, hero_size, special_ability,
849
+ sequence, seq_len, helix_bias, strand_bias, loop_bias,
850
+ secondary_structure, aa_bias, aa_bias_potential,
851
+ num_steps, noise, hydrophobic_target_score, hydrophobic_potential,
852
+ contigs, pssm, seq_mask, str_mask, rewrite_pdb
853
+ ],
854
+ outputs=[
855
+ hero_stats,
856
+ hero_description,
857
+ output_seq,
858
+ output_pdb,
859
+ output_viewer,
860
+ plddt_plot
861
+ ]
862
  )
863
 
864
+ design_btn.click(
865
  combined_generation,
866
+ inputs=[
867
+ hero_name, strength, flexibility, speed, defense, hero_size, special_ability,
868
+ sequence, seq_len, helix_bias, strand_bias, loop_bias,
869
+ secondary_structure, aa_bias, aa_bias_potential,
870
+ num_steps, noise, hydrophobic_target_score, hydrophobic_potential,
871
+ contigs, pssm, seq_mask, str_mask, rewrite_pdb
872
+ ],
873
+ outputs=[
874
+ hero_stats,
875
+ hero_description,
876
+ output_seq,
877
+ output_pdb,
878
+ output_viewer,
879
+ plddt_plot
880
+ ]
881
  )
882
 
883
+ enhance_btn.click(
884
  combined_generation,
885
+ inputs=[
886
+ hero_name, strength, flexibility, speed, defense, hero_size, special_ability,
887
+ sequence, seq_len, helix_bias, strand_bias, loop_bias,
888
+ secondary_structure, aa_bias, aa_bias_potential,
889
+ num_steps, noise, hydrophobic_target_score, hydrophobic_potential,
890
+ contigs, pssm, seq_mask, str_mask, rewrite_pdb
891
+ ],
892
+ outputs=[
893
+ hero_stats,
894
+ hero_description,
895
+ output_seq,
896
+ output_pdb,
897
+ output_viewer,
898
+ plddt_plot
899
+ ]
900
  )
901
 
902
+ inherit_btn.click(
 
903
  combined_generation,
904
  inputs=[
905
  hero_name, strength, flexibility, speed, defense, hero_size, special_ability,
 
919
  )
920
 
921
  demo.queue()
922
+ demo.launch(debug=True)