Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -96,14 +96,21 @@ def generate_response(manual, proposal):
|
|
| 96 |
return response.choices[0].message.content
|
| 97 |
|
| 98 |
def generate_html(llm_response):
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
| 101 |
for line in lines:
|
| 102 |
-
line = line.strip()
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
return html
|
| 106 |
-
|
| 107 |
#================================================Gradio==================
|
| 108 |
|
| 109 |
def update_log(newRecords):
|
|
|
|
| 96 |
return response.choices[0].message.content
|
| 97 |
|
| 98 |
def generate_html(llm_response):
|
| 99 |
+
"""Convert LLM response to HTML table row with line breaks."""
|
| 100 |
+
lines = llm_response.strip().split('\n') # Fixed: \n not \\n
|
| 101 |
+
html_lines = []
|
| 102 |
+
|
| 103 |
for line in lines:
|
| 104 |
+
line = line.strip()
|
| 105 |
+
if line: # Skip empty lines
|
| 106 |
+
html_lines.append(line)
|
| 107 |
+
|
| 108 |
+
# Build proper <tr><td> with <br> for lines
|
| 109 |
+
content = '<br>'.join(html_lines) # Single <br> between lines
|
| 110 |
+
html = f"<tr><td>{content}</td></tr>"
|
| 111 |
+
|
| 112 |
return html
|
| 113 |
+
|
| 114 |
#================================================Gradio==================
|
| 115 |
|
| 116 |
def update_log(newRecords):
|