Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,7 @@ def process_inputs(user_input_json, session_id_json, project_id, chat_url, updat
|
|
| 43 |
session_id = convert_inputs(user_input,session_id)
|
| 44 |
# project_id = convert_inputs(user_input,project_id)
|
| 45 |
update_vars = convert_inputs(user_input,update_vars)
|
| 46 |
-
output_vars =
|
| 47 |
|
| 48 |
# --- Your function logic here ---
|
| 49 |
df = pd.DataFrame({
|
|
@@ -111,7 +111,7 @@ def run_process(df):
|
|
| 111 |
df.loc[index, "answer"] = answer
|
| 112 |
csv_path = "output.csv"
|
| 113 |
df.to_csv(csv_path, index=False)
|
| 114 |
-
return csv_path
|
| 115 |
|
| 116 |
|
| 117 |
with gr.Blocks() as demo:
|
|
@@ -140,7 +140,7 @@ with gr.Blocks() as demo:
|
|
| 140 |
process_btn.click(
|
| 141 |
fn=run_process,
|
| 142 |
inputs=df_output,
|
| 143 |
-
outputs=file_output
|
| 144 |
)
|
| 145 |
|
| 146 |
run_btn.click(
|
|
|
|
| 43 |
session_id = convert_inputs(user_input,session_id)
|
| 44 |
# project_id = convert_inputs(user_input,project_id)
|
| 45 |
update_vars = convert_inputs(user_input,update_vars)
|
| 46 |
+
output_vars = convert_output_vars(user_input,output_vars)
|
| 47 |
|
| 48 |
# --- Your function logic here ---
|
| 49 |
df = pd.DataFrame({
|
|
|
|
| 111 |
df.loc[index, "answer"] = answer
|
| 112 |
csv_path = "output.csv"
|
| 113 |
df.to_csv(csv_path, index=False)
|
| 114 |
+
return csv_path, df
|
| 115 |
|
| 116 |
|
| 117 |
with gr.Blocks() as demo:
|
|
|
|
| 140 |
process_btn.click(
|
| 141 |
fn=run_process,
|
| 142 |
inputs=df_output,
|
| 143 |
+
outputs=[file_output, df_output]
|
| 144 |
)
|
| 145 |
|
| 146 |
run_btn.click(
|