Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -100,11 +100,29 @@ elif selection=="Adobe Firefly":
|
|
100 |
with open('wiki_1.json', 'r') as fr:
|
101 |
list_1 = json.load(fr)
|
102 |
|
103 |
-
with open('wiki_2.json', 'r') as fr:
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
else:
|
109 |
with open('wiki_2.json', 'r') as fr:
|
110 |
list_1 = json.load(fr)
|
@@ -171,7 +189,7 @@ if st.button('Submit'):
|
|
171 |
st.session_state.summarize_clicked = False
|
172 |
st.session_state.organize_clicked = True
|
173 |
st.header("Organization of the documents in the narrative")
|
174 |
-
topics_list = [
|
175 |
|
176 |
organize_list = []
|
177 |
ui_organize_list = []
|
@@ -190,7 +208,7 @@ if st.button('Submit'):
|
|
190 |
# st.session_state.narrative_clicked = False
|
191 |
st.session_state.summarize_clicked = True
|
192 |
st.header("Intent-based multi-document summary")
|
193 |
-
topics_list = [
|
194 |
generate_list = []
|
195 |
ui_generate_list = []
|
196 |
slides_list = []
|
|
|
100 |
with open('wiki_1.json', 'r') as fr:
|
101 |
list_1 = json.load(fr)
|
102 |
|
103 |
+
# with open('wiki_2.json', 'r') as fr:
|
104 |
+
# list_2 = json.load(fr)
|
105 |
+
|
106 |
+
tmp_ref_abstract = {}
|
107 |
+
|
108 |
+
|
109 |
+
file_count=0
|
110 |
+
for file in uploaded_files:
|
111 |
+
tmp_filename = file.name
|
112 |
+
tmp_content = file.read().decode('utf-8').strip()
|
113 |
+
tmp_ref_abstract[tmp_filename] = tmp_content
|
114 |
+
file_count+=1
|
115 |
+
|
116 |
+
document_name = presentation_title
|
117 |
+
section_names = [slide_title]*file_count
|
118 |
+
ref_doc_indices = np.arange(1,file_count+1).tolist()
|
119 |
+
|
120 |
+
list_2 = [
|
121 |
+
{
|
122 |
+
"abstract": "Write the '{}' section of the article titled '{}'.".format(slide_title, presentation_title),
|
123 |
+
"ref_abstract": tmp_ref_abstract
|
124 |
+
}
|
125 |
+
]
|
126 |
else:
|
127 |
with open('wiki_2.json', 'r') as fr:
|
128 |
list_1 = json.load(fr)
|
|
|
189 |
st.session_state.summarize_clicked = False
|
190 |
st.session_state.organize_clicked = True
|
191 |
st.header("Organization of the documents in the narrative")
|
192 |
+
topics_list = [slide_title]
|
193 |
|
194 |
organize_list = []
|
195 |
ui_organize_list = []
|
|
|
208 |
# st.session_state.narrative_clicked = False
|
209 |
st.session_state.summarize_clicked = True
|
210 |
st.header("Intent-based multi-document summary")
|
211 |
+
topics_list = [slide_title]
|
212 |
generate_list = []
|
213 |
ui_generate_list = []
|
214 |
slides_list = []
|