Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -138,18 +138,22 @@ class CombinedProcessor:
|
|
| 138 |
bibtex_entry = create_bibtex_entry(bibtex_data)
|
| 139 |
bibtex_entries.append(bibtex_entry)
|
| 140 |
|
| 141 |
-
# Join BibTeX entries with
|
| 142 |
-
|
|
|
|
| 143 |
|
| 144 |
# Create the processor instance
|
| 145 |
processor = CombinedProcessor()
|
| 146 |
|
|
|
|
|
|
|
|
|
|
| 147 |
# Define the Gradio interface
|
| 148 |
with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
|
| 149 |
-
gr.HTML("""<h1 style="text-align:center">
|
| 150 |
text_input = gr.Textbox(label="Your text", type="text", lines=10)
|
| 151 |
text_button = gr.Button("Process Text")
|
| 152 |
-
bibtex_output = gr.
|
| 153 |
text_button.click(processor.process, inputs=text_input, outputs=[bibtex_output])
|
| 154 |
|
| 155 |
if __name__ == "__main__":
|
|
|
|
| 138 |
bibtex_entry = create_bibtex_entry(bibtex_data)
|
| 139 |
bibtex_entries.append(bibtex_entry)
|
| 140 |
|
| 141 |
+
# Join BibTeX entries with HTML formatting
|
| 142 |
+
formatted_entries = ["<pre>" + html.escape(entry) + "</pre>" for entry in bibtex_entries]
|
| 143 |
+
return "<br>".join(formatted_entries)
|
| 144 |
|
| 145 |
# Create the processor instance
|
| 146 |
processor = CombinedProcessor()
|
| 147 |
|
| 148 |
+
# Define the Gradio interface
|
| 149 |
+
# ... (previous parts of the script remain unchanged)
|
| 150 |
+
|
| 151 |
# Define the Gradio interface
|
| 152 |
with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
|
| 153 |
+
gr.HTML("""<h1 style="text-align:center">Combined Editorial and Bibliography Processor</h1>""")
|
| 154 |
text_input = gr.Textbox(label="Your text", type="text", lines=10)
|
| 155 |
text_button = gr.Button("Process Text")
|
| 156 |
+
bibtex_output = gr.Textbox(label="BibTeX Entries", lines=15)
|
| 157 |
text_button.click(processor.process, inputs=text_input, outputs=[bibtex_output])
|
| 158 |
|
| 159 |
if __name__ == "__main__":
|