Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,8 @@ def stream_chat_with_rag(
|
|
34 |
print("top works from API:")
|
35 |
print(fig)
|
36 |
|
37 |
-
return answer, fig
|
|
|
38 |
|
39 |
|
40 |
|
@@ -44,6 +45,8 @@ def heatmap(top_n):
|
|
44 |
top_n= top_n,
|
45 |
api_name="/get_heatmap_pivot_table"
|
46 |
)
|
|
|
|
|
47 |
|
48 |
plt.figure(figsize=(10, 8))
|
49 |
sns.heatmap(pivot_table,
|
@@ -135,10 +138,15 @@ with gr.Blocks(title="Reddit Election Analysis") as demo:
|
|
135 |
)
|
136 |
|
137 |
# Update both outputs when submit is clicked
|
|
|
|
|
|
|
|
|
|
|
138 |
submit_btn.click(
|
139 |
fn=stream_chat_with_rag,
|
140 |
inputs=[query_input, year_selector],
|
141 |
-
outputs=
|
142 |
)
|
143 |
|
144 |
|
|
|
34 |
print("top works from API:")
|
35 |
print(fig)
|
36 |
|
37 |
+
# return answer, fig
|
38 |
+
return answer
|
39 |
|
40 |
|
41 |
|
|
|
45 |
top_n= top_n,
|
46 |
api_name="/get_heatmap_pivot_table"
|
47 |
)
|
48 |
+
print(pivot_table)
|
49 |
+
print(type(pivot_table))
|
50 |
|
51 |
plt.figure(figsize=(10, 8))
|
52 |
sns.heatmap(pivot_table,
|
|
|
138 |
)
|
139 |
|
140 |
# Update both outputs when submit is clicked
|
141 |
+
# submit_btn.click(
|
142 |
+
# fn=stream_chat_with_rag,
|
143 |
+
# inputs=[query_input, year_selector],
|
144 |
+
# outputs=[output_text, output_plot]
|
145 |
+
# )
|
146 |
submit_btn.click(
|
147 |
fn=stream_chat_with_rag,
|
148 |
inputs=[query_input, year_selector],
|
149 |
+
outputs=output_text
|
150 |
)
|
151 |
|
152 |
|