Spaces:
Running
Running
Single document approach
Browse files
app.py
CHANGED
@@ -98,19 +98,20 @@ def highlight_edits():
|
|
98 |
import html
|
99 |
prompt = get_prompt(include_generation_options=False)
|
100 |
st.write("Prompt:", prompt)
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
114 |
|
115 |
spans = get_highlights(prompt, doc, updated_doc)
|
116 |
|
|
|
98 |
import html
|
99 |
prompt = get_prompt(include_generation_options=False)
|
100 |
st.write("Prompt:", prompt)
|
101 |
+
doc = st.session_state.get('doc', "")
|
102 |
+
if doc:
|
103 |
+
st.write("Generating suggestions based on the following document:")
|
104 |
+
st.write(doc)
|
105 |
+
else:
|
106 |
+
st.write("Enter a document to see suggestions.")
|
107 |
+
updated_doc = st.text_area(
|
108 |
+
"Document",
|
109 |
+
"Deep learning neural network technology advances are pretty cool if you are careful to use it in ways that don't take stuff from people.",
|
110 |
+
height=300, key='updated_doc',
|
111 |
+
)
|
112 |
+
def save_document():
|
113 |
+
st.session_state['doc'] = updated_doc
|
114 |
+
st.button("Save document", on_click=save_document)
|
115 |
|
116 |
spans = get_highlights(prompt, doc, updated_doc)
|
117 |
|