agentharbor commited on
Commit
d46a650
·
verified ·
1 Parent(s): 3f55db3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -99,11 +99,15 @@ def get_images_in_directory(directory):
99
  image_files.append(os.path.join(root, file))
100
  return image_files
101
 
102
- def interact_with_agent(file_input, additional_notes):
103
  shutil.rmtree("./figures")
104
  os.makedirs("./figures")
105
-
 
 
 
106
  data_file = pd.read_csv(file_input)
 
107
  data_structure_notes = f"""- Description (output of .describe()):
108
  {data_file.describe()}
109
  - Columns with dtypes:
@@ -146,10 +150,11 @@ with gr.Blocks(
146
  secondary_hue=gr.themes.colors.blue,
147
  )
148
  ) as demo:
149
- gr.Markdown("""# Agentville Autonomous Data Exploration 📈🧠
150
 
151
  Drop a `.csv` file below, add notes to describe this data if needed, and **Agents powered by Gemini and Llama-3.1-70B will analyze the file content and does the analysis for you!**""")
152
  file_input = gr.File(label="Your file to analyze")
 
153
  text_input = gr.Textbox(
154
  label="Additional notes to guide the analysis"
155
  )
@@ -164,11 +169,11 @@ Drop a `.csv` file below, add notes to describe this data if needed, and **Agent
164
  )
165
  gr.Examples(
166
  examples=[["./example/churn.csv", example_notes]],
167
- inputs=[file_input, text_input],
168
  cache_examples=False
169
  )
170
 
171
- submit.click(interact_with_agent, [file_input, text_input], [chatbot])
172
 
173
  if __name__ == "__main__":
174
  demo.launch()
 
99
  image_files.append(os.path.join(root, file))
100
  return image_files
101
 
102
+ def interact_with_agent(file_input, file_input_2, additional_notes):
103
  shutil.rmtree("./figures")
104
  os.makedirs("./figures")
105
+ file_1 = pd.read_csv(file_input)
106
+ file_2 = pd.read_csv(file_input_2)
107
+ print (file_1.head())
108
+ print (file_2.head())
109
  data_file = pd.read_csv(file_input)
110
+
111
  data_structure_notes = f"""- Description (output of .describe()):
112
  {data_file.describe()}
113
  - Columns with dtypes:
 
150
  secondary_hue=gr.themes.colors.blue,
151
  )
152
  ) as demo:
153
+ gr.Markdown("""# Agentville Autonomous Data Exploration 📈🧠 (Research preview)
154
 
155
  Drop a `.csv` file below, add notes to describe this data if needed, and **Agents powered by Gemini and Llama-3.1-70B will analyze the file content and does the analysis for you!**""")
156
  file_input = gr.File(label="Your file to analyze")
157
+ file_input_2 = gr.File(label="Your file to analyze")
158
  text_input = gr.Textbox(
159
  label="Additional notes to guide the analysis"
160
  )
 
169
  )
170
  gr.Examples(
171
  examples=[["./example/churn.csv", example_notes]],
172
+ inputs=[file_input, file_input_2, text_input],
173
  cache_examples=False
174
  )
175
 
176
+ submit.click(interact_with_agent, [file_input, file_input_2,text_input], [chatbot])
177
 
178
  if __name__ == "__main__":
179
  demo.launch()