Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -61,6 +61,7 @@ def format_constraints_html(constraints: dict) -> str:
|
|
61 |
html_content = "<div class='constraints-container'>"
|
62 |
for title, description in constraints.items():
|
63 |
html_content += f"""
|
|
|
64 |
<div class='constraint-item'>
|
65 |
<p><span class='constraint-title'>{title}:</span> <span class='constraint-description'>{description}</span></p>
|
66 |
</div>
|
@@ -75,6 +76,7 @@ def format_best_combinations_html(combinations_data: list) -> str:
|
|
75 |
technologies = combination.get("technologies", [])
|
76 |
|
77 |
html_content += f"""
|
|
|
78 |
<div class='problem-card'>
|
79 |
<h3 class='problem-card-title'>{problem_title}</h3>
|
80 |
<div class='technologies-inner-container'>
|
@@ -83,6 +85,7 @@ def format_best_combinations_html(combinations_data: list) -> str:
|
|
83 |
tech_info = tech_info_score[0] # The dictionary part
|
84 |
if isinstance(tech_info, dict):
|
85 |
html_content += f"""
|
|
|
86 |
<div class='technology-card'>
|
87 |
<h4 class='tech-card-title'>{tech_info.get('title', 'N/A')}</h4>
|
88 |
<p><strong>Purpose:</strong> {tech_info.get('purpose', 'N/A')}</p>
|
@@ -103,6 +106,7 @@ def format_final_technologies_html(technologies_list: list) -> str:
|
|
103 |
for tech_info in technologies_list:
|
104 |
if isinstance(tech_info, dict):
|
105 |
html_content += f"""
|
|
|
106 |
<div class='final-tech-card'>
|
107 |
<h4 class='final-tech-title'>{tech_info.get('title', 'N/A')}</h4>
|
108 |
<p><strong>Purpose:</strong> {tech_info.get('purpose', 'N/A')}</p>
|
@@ -181,12 +185,9 @@ input_problem = gr.Textbox(
|
|
181 |
)
|
182 |
|
183 |
output_prompt = gr.Textbox(label="1. Generated Prompt", interactive=False)
|
184 |
-
title_constraints = gr.HTML("<h1>Retrieved Constraints</h1>")
|
185 |
output_constraints = gr.HTML(label="2. Retrieved Constraints") # Changed to HTML
|
186 |
-
title_best_combinations = gr.HTML("<h1>The 5 Best Technology Combinations Found</h1>")
|
187 |
output_best_combinations = gr.HTML(label="7. Best Technology Combinations Found") # Changed to HTML
|
188 |
output_selected_ids = gr.Textbox(label="8. Selected Technology IDs", interactive=False)
|
189 |
-
title_final_combination = gr.HTML("<h1>The best technology combinations for each constraint</h1>")
|
190 |
output_final_technologies = gr.HTML(label="9. Final Best Technologies") # Changed to HTML
|
191 |
|
192 |
# Custom CSS for a professional look and specific output styling
|
|
|
61 |
html_content = "<div class='constraints-container'>"
|
62 |
for title, description in constraints.items():
|
63 |
html_content += f"""
|
64 |
+
<h1>Retrieved Constraints</h1>
|
65 |
<div class='constraint-item'>
|
66 |
<p><span class='constraint-title'>{title}:</span> <span class='constraint-description'>{description}</span></p>
|
67 |
</div>
|
|
|
76 |
technologies = combination.get("technologies", [])
|
77 |
|
78 |
html_content += f"""
|
79 |
+
<h1>Retrieved Constraints</h1>
|
80 |
<div class='problem-card'>
|
81 |
<h3 class='problem-card-title'>{problem_title}</h3>
|
82 |
<div class='technologies-inner-container'>
|
|
|
85 |
tech_info = tech_info_score[0] # The dictionary part
|
86 |
if isinstance(tech_info, dict):
|
87 |
html_content += f"""
|
88 |
+
<h1>The 5 Best Technology Combinations Found</h1>
|
89 |
<div class='technology-card'>
|
90 |
<h4 class='tech-card-title'>{tech_info.get('title', 'N/A')}</h4>
|
91 |
<p><strong>Purpose:</strong> {tech_info.get('purpose', 'N/A')}</p>
|
|
|
106 |
for tech_info in technologies_list:
|
107 |
if isinstance(tech_info, dict):
|
108 |
html_content += f"""
|
109 |
+
<h1>The best technology combinations for each constraint</h1>
|
110 |
<div class='final-tech-card'>
|
111 |
<h4 class='final-tech-title'>{tech_info.get('title', 'N/A')}</h4>
|
112 |
<p><strong>Purpose:</strong> {tech_info.get('purpose', 'N/A')}</p>
|
|
|
185 |
)
|
186 |
|
187 |
output_prompt = gr.Textbox(label="1. Generated Prompt", interactive=False)
|
|
|
188 |
output_constraints = gr.HTML(label="2. Retrieved Constraints") # Changed to HTML
|
|
|
189 |
output_best_combinations = gr.HTML(label="7. Best Technology Combinations Found") # Changed to HTML
|
190 |
output_selected_ids = gr.Textbox(label="8. Selected Technology IDs", interactive=False)
|
|
|
191 |
output_final_technologies = gr.HTML(label="9. Final Best Technologies") # Changed to HTML
|
192 |
|
193 |
# Custom CSS for a professional look and specific output styling
|