Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -190,7 +190,7 @@ def generate_rag(
|
|
190 |
result = rag_chain.invoke({"input": prompt})
|
191 |
from pprint import pprint
|
192 |
pprint(result)
|
193 |
-
return result['cited_text'][0]['text'], result['cited_text'][1]['citations']
|
194 |
|
195 |
|
196 |
def process_input(topic, length, tone, format_, pdfs):
|
@@ -237,9 +237,9 @@ def create_app():
|
|
237 |
)
|
238 |
length_input = gr.Slider(
|
239 |
minimum=50,
|
240 |
-
maximum=
|
241 |
step=50,
|
242 |
-
value=
|
243 |
label="Article Length",
|
244 |
elem_classes="input-highlight-pink",
|
245 |
)
|
@@ -282,7 +282,7 @@ def create_app():
|
|
282 |
generate_button = gr.Button("Generate")
|
283 |
with gr.Column(scale=3):
|
284 |
generated_text_output = gr.Textbox(label="Generated Text", lines=10)
|
285 |
-
citations_output = gr.
|
286 |
|
287 |
generate_button.click(
|
288 |
fn=process_input,
|
|
|
190 |
result = rag_chain.invoke({"input": prompt})
|
191 |
from pprint import pprint
|
192 |
pprint(result)
|
193 |
+
return result['cited_text'][0]['text'], citations_to_html(result['cited_text'][1]['citations'])
|
194 |
|
195 |
|
196 |
def process_input(topic, length, tone, format_, pdfs):
|
|
|
237 |
)
|
238 |
length_input = gr.Slider(
|
239 |
minimum=50,
|
240 |
+
maximum=500,
|
241 |
step=50,
|
242 |
+
value=200,
|
243 |
label="Article Length",
|
244 |
elem_classes="input-highlight-pink",
|
245 |
)
|
|
|
282 |
generate_button = gr.Button("Generate")
|
283 |
with gr.Column(scale=3):
|
284 |
generated_text_output = gr.Textbox(label="Generated Text", lines=10)
|
285 |
+
citations_output = gr.HTML(label="Citations")
|
286 |
|
287 |
generate_button.click(
|
288 |
fn=process_input,
|