Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -583,6 +583,7 @@ def combined_generation(name, strength, flexibility, speed, defense, size, abili
|
|
| 583 |
None
|
| 584 |
)
|
| 585 |
|
|
|
|
| 586 |
with gr.Blocks(theme='ParityError/Interstellar') as demo:
|
| 587 |
with gr.Row():
|
| 588 |
# 왼쪽 열: 챗봇 및 컨트롤 패널
|
|
@@ -590,6 +591,12 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
|
|
| 590 |
# 챗봇 인터페이스
|
| 591 |
gr.Markdown("# 🤖 AI 단백질 설계 도우미")
|
| 592 |
chatbot = gr.Chatbot(height=600)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 593 |
|
| 594 |
with gr.Accordion("채팅 설정", open=False):
|
| 595 |
system_message = gr.Textbox(
|
|
@@ -942,6 +949,13 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
|
|
| 942 |
]
|
| 943 |
)
|
| 944 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 945 |
# 챗봇 응답에 따른 결과 업데이트
|
| 946 |
msg.submit(
|
| 947 |
update_protein_display,
|
|
@@ -949,16 +963,6 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
|
|
| 949 |
outputs=[hero_stats, hero_description, output_seq, output_pdb, output_viewer, plddt_plot]
|
| 950 |
)
|
| 951 |
|
| 952 |
-
chat_interface = gr.ChatInterface(
|
| 953 |
-
respond,
|
| 954 |
-
additional_inputs=[
|
| 955 |
-
system_message,
|
| 956 |
-
max_tokens,
|
| 957 |
-
temperature,
|
| 958 |
-
top_p,
|
| 959 |
-
],
|
| 960 |
-
chatbot=chatbot,
|
| 961 |
-
)
|
| 962 |
|
| 963 |
# 실행
|
| 964 |
demo.queue()
|
|
|
|
| 583 |
None
|
| 584 |
)
|
| 585 |
|
| 586 |
+
# Gradio 인터페이스 수정
|
| 587 |
with gr.Blocks(theme='ParityError/Interstellar') as demo:
|
| 588 |
with gr.Row():
|
| 589 |
# 왼쪽 열: 챗봇 및 컨트롤 패널
|
|
|
|
| 591 |
# 챗봇 인터페이스
|
| 592 |
gr.Markdown("# 🤖 AI 단백질 설계 도우미")
|
| 593 |
chatbot = gr.Chatbot(height=600)
|
| 594 |
+
msg = gr.Textbox(
|
| 595 |
+
label="메시지를 입력하세요",
|
| 596 |
+
placeholder="예: COVID-19를 치료할 수 있는 단백질을 생성해주세요",
|
| 597 |
+
lines=2
|
| 598 |
+
)
|
| 599 |
+
clear = gr.Button("대화 내용 지우기")
|
| 600 |
|
| 601 |
with gr.Accordion("채팅 설정", open=False):
|
| 602 |
system_message = gr.Textbox(
|
|
|
|
| 949 |
]
|
| 950 |
)
|
| 951 |
|
| 952 |
+
# 이벤트 연결
|
| 953 |
+
# 챗봇 이벤트
|
| 954 |
+
msg.submit(respond,
|
| 955 |
+
[msg, chatbot, system_message, max_tokens, temperature, top_p],
|
| 956 |
+
[chatbot])
|
| 957 |
+
clear.click(lambda: None, None, chatbot, queue=False)
|
| 958 |
+
|
| 959 |
# 챗봇 응답에 따른 결과 업데이트
|
| 960 |
msg.submit(
|
| 961 |
update_protein_display,
|
|
|
|
| 963 |
outputs=[hero_stats, hero_description, output_seq, output_pdb, output_viewer, plddt_plot]
|
| 964 |
)
|
| 965 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 966 |
|
| 967 |
# 실행
|
| 968 |
demo.queue()
|