Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -760,131 +760,7 @@ The response should be in HTML format with appropriate styling."""
|
|
| 760 |
|
| 761 |
|
| 762 |
|
| 763 |
-
|
| 764 |
-
with gr.Tabs(elem_classes="main-tabs") as tabs:
|
| 765 |
-
with gr.Tab("Visual AI Assistant", elem_id="mouse-tab", elem_classes="mouse-tab"):
|
| 766 |
-
setting = gr.State({
|
| 767 |
-
"system": SystemPrompt,
|
| 768 |
-
})
|
| 769 |
-
|
| 770 |
-
#NEW - 검색 모드 상태 추가
|
| 771 |
-
search_mode = gr.State(False)
|
| 772 |
-
|
| 773 |
-
with ms.Application() as app:
|
| 774 |
-
with antd.ConfigProvider():
|
| 775 |
-
#NEW - 모드 선택 라디오 버튼 추가
|
| 776 |
-
with gr.Row():
|
| 777 |
-
mode = gr.Radio(
|
| 778 |
-
choices=["Generate", "Generate + Web Search"],
|
| 779 |
-
label="Mode",
|
| 780 |
-
value="Generate",
|
| 781 |
-
info="Select 'Generate + Web Search' to include web search results",
|
| 782 |
-
elem_classes="mode-selector"
|
| 783 |
-
)
|
| 784 |
-
|
| 785 |
-
with antd.Drawer(open=False, title="AI is Creating...", placement="left", width="750px") as code_drawer:
|
| 786 |
-
gr.HTML("""
|
| 787 |
-
<div class="thinking-container">
|
| 788 |
-
<style>
|
| 789 |
-
.custom-textarea {
|
| 790 |
-
background: #f8f9fa !important;
|
| 791 |
-
border: 1px solid #e0e0e0 !important;
|
| 792 |
-
border-radius: 10px !important;
|
| 793 |
-
padding: 15px !important;
|
| 794 |
-
min-height: 150px !important;
|
| 795 |
-
font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
|
| 796 |
-
}
|
| 797 |
-
|
| 798 |
-
.custom-textarea:focus {
|
| 799 |
-
border-color: #007aff !important;
|
| 800 |
-
box-shadow: 0 0 0 2px rgba(0,122,255,0.2) !important;
|
| 801 |
-
}
|
| 802 |
-
|
| 803 |
-
.thinking-container {
|
| 804 |
-
text-align: center;
|
| 805 |
-
padding: 20px;
|
| 806 |
-
background: #f8f9fa;
|
| 807 |
-
border-radius: 15px;
|
| 808 |
-
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
|
| 809 |
-
}
|
| 810 |
-
|
| 811 |
-
.progress-bar {
|
| 812 |
-
width: 100%;
|
| 813 |
-
height: 4px;
|
| 814 |
-
background: #e9ecef;
|
| 815 |
-
border-radius: 4px;
|
| 816 |
-
margin: 20px 0;
|
| 817 |
-
overflow: hidden;
|
| 818 |
-
}
|
| 819 |
-
|
| 820 |
-
.progress-bar-inner {
|
| 821 |
-
width: 30%;
|
| 822 |
-
height: 100%;
|
| 823 |
-
background: linear-gradient(90deg, #007aff, #28c840);
|
| 824 |
-
animation: progress 2s ease-in-out infinite;
|
| 825 |
-
}
|
| 826 |
-
|
| 827 |
-
.thinking-icon {
|
| 828 |
-
font-size: 48px;
|
| 829 |
-
margin: 20px 0;
|
| 830 |
-
animation: bounce 1s ease infinite;
|
| 831 |
-
}
|
| 832 |
-
|
| 833 |
-
.tip-box {
|
| 834 |
-
background: white;
|
| 835 |
-
padding: 20px;
|
| 836 |
-
border-radius: 10px;
|
| 837 |
-
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
| 838 |
-
margin: 20px 0;
|
| 839 |
-
transition: all 0.3s ease;
|
| 840 |
-
}
|
| 841 |
-
|
| 842 |
-
.status-text {
|
| 843 |
-
color: #007aff;
|
| 844 |
-
font-size: 18px;
|
| 845 |
-
margin: 15px 0;
|
| 846 |
-
animation: fade 1.5s ease infinite;
|
| 847 |
-
}
|
| 848 |
-
|
| 849 |
-
.icon-grid {
|
| 850 |
-
display: grid;
|
| 851 |
-
grid-template-columns: repeat(4, 1fr);
|
| 852 |
-
gap: 15px;
|
| 853 |
-
margin: 20px 0;
|
| 854 |
-
}
|
| 855 |
-
|
| 856 |
-
.icon-item {
|
| 857 |
-
padding: 10px;
|
| 858 |
-
background: rgba(0,122,255,0.1);
|
| 859 |
-
border-radius: 8px;
|
| 860 |
-
animation: pulse 2s ease infinite;
|
| 861 |
-
}
|
| 862 |
-
|
| 863 |
-
@keyframes progress {
|
| 864 |
-
0% { transform: translateX(-100%); }
|
| 865 |
-
100% { transform: translateX(400%); }
|
| 866 |
-
}
|
| 867 |
-
|
| 868 |
-
@keyframes bounce {
|
| 869 |
-
0%, 100% { transform: translateY(0); }
|
| 870 |
-
50% { transform: translateY(-10px); }
|
| 871 |
-
}
|
| 872 |
-
|
| 873 |
-
@keyframes fade {
|
| 874 |
-
0%, 100% { opacity: 1; }
|
| 875 |
-
50% { opacity: 0.6; }
|
| 876 |
-
}
|
| 877 |
-
|
| 878 |
-
@keyframes pulse {
|
| 879 |
-
0% { transform: scale(1); }
|
| 880 |
-
50% { transform: scale(1.05); }
|
| 881 |
-
100% { transform: scale(1); }
|
| 882 |
-
}
|
| 883 |
-
</style>
|
| 884 |
-
|
| 885 |
-
|
| 886 |
-
|
| 887 |
-
with demo:
|
| 888 |
with gr.Tabs(elem_classes="main-tabs") as tabs:
|
| 889 |
with gr.Tab("Visual AI Assistant", elem_id="mouse-tab", elem_classes="mouse-tab"):
|
| 890 |
setting = gr.State({
|
|
|
|
| 760 |
|
| 761 |
|
| 762 |
|
| 763 |
+
with demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 764 |
with gr.Tabs(elem_classes="main-tabs") as tabs:
|
| 765 |
with gr.Tab("Visual AI Assistant", elem_id="mouse-tab", elem_classes="mouse-tab"):
|
| 766 |
setting = gr.State({
|