Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -61,13 +61,12 @@ 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 |
-
<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>
|
68 |
"""
|
69 |
html_content += "</div>"
|
70 |
-
return html_content
|
71 |
|
72 |
def format_best_combinations_html(combinations_data: list) -> str:
|
73 |
html_content = "<div class='combinations-outer-container'>"
|
@@ -76,7 +75,6 @@ def format_best_combinations_html(combinations_data: list) -> str:
|
|
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,7 +83,6 @@ def format_best_combinations_html(combinations_data: list) -> str:
|
|
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>
|
@@ -99,14 +96,13 @@ def format_best_combinations_html(combinations_data: list) -> str:
|
|
99 |
</div>
|
100 |
"""
|
101 |
html_content += "</div>"
|
102 |
-
return html_content
|
103 |
|
104 |
def format_final_technologies_html(technologies_list: list) -> str:
|
105 |
html_content = "<div class='final-tech-container'>"
|
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>
|
@@ -116,7 +112,7 @@ def format_final_technologies_html(technologies_list: list) -> str:
|
|
116 |
</div>
|
117 |
"""
|
118 |
html_content += "</div>"
|
119 |
-
return html_content
|
120 |
|
121 |
def process_input_gradio(problem_description: str):
|
122 |
"""
|
|
|
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>
|
67 |
"""
|
68 |
html_content += "</div>"
|
69 |
+
return "<h1>Retrieved Constraints</h1>" + html_content
|
70 |
|
71 |
def format_best_combinations_html(combinations_data: list) -> str:
|
72 |
html_content = "<div class='combinations-outer-container'>"
|
|
|
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 |
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>
|
|
|
96 |
</div>
|
97 |
"""
|
98 |
html_content += "</div>"
|
99 |
+
return "<h1>The 5 Best Technology Combinations per constraint</h1>" + html_content
|
100 |
|
101 |
def format_final_technologies_html(technologies_list: list) -> str:
|
102 |
html_content = "<div class='final-tech-container'>"
|
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>
|
|
|
112 |
</div>
|
113 |
"""
|
114 |
html_content += "</div>"
|
115 |
+
return "<h1>The best technologies combinations </h1>" + html_content
|
116 |
|
117 |
def process_input_gradio(problem_description: str):
|
118 |
"""
|