Spaces:
Running
Running
debuig
Browse files
app.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
#
|
2 |
-
|
3 |
import gradio as gr
|
4 |
import pandas as pd
|
5 |
|
@@ -13,14 +11,13 @@ def process_file(file, question):
|
|
13 |
# 将 DataFrame 转换为字符串
|
14 |
df_string = df.to_string()
|
15 |
|
16 |
-
#
|
17 |
-
# 您可以根据需要添加额外的逻辑
|
18 |
return df_string + "\nQ: " + question
|
19 |
|
20 |
iface = gr.Interface(
|
21 |
fn=process_file,
|
22 |
-
inputs=[gr.
|
23 |
-
outputs="
|
24 |
)
|
25 |
|
26 |
iface.launch()
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
|
|
|
11 |
# 将 DataFrame 转换为字符串
|
12 |
df_string = df.to_string()
|
13 |
|
14 |
+
# 返回 DataFrame 字符串和用户问题
|
|
|
15 |
return df_string + "\nQ: " + question
|
16 |
|
17 |
iface = gr.Interface(
|
18 |
fn=process_file,
|
19 |
+
inputs=[gr.File(label="Upload your file"), gr.Textbox(label="Your Question")],
|
20 |
+
outputs=gr.Text(label="Output")
|
21 |
)
|
22 |
|
23 |
iface.launch()
|