Spaces:
Sleeping
Sleeping
Dacho688
commited on
Commit
·
69b18c8
1
Parent(s):
42c2cb4
fix app
Browse files- README.md +1 -0
- __pycache__/streaming.cpython-311.pyc +0 -0
- app.py +4 -8
- requirements.txt +3 -2
README.md
CHANGED
@@ -5,6 +5,7 @@ colorFrom: yellow
|
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.38.1
|
|
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: apache-2.0
|
|
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.38.1
|
8 |
+
python_version: 3.9
|
9 |
app_file: app.py
|
10 |
pinned: false
|
11 |
license: apache-2.0
|
__pycache__/streaming.cpython-311.pyc
CHANGED
Binary files a/__pycache__/streaming.cpython-311.pyc and b/__pycache__/streaming.cpython-311.pyc differ
|
|
app.py
CHANGED
@@ -5,7 +5,7 @@ from transformers import ReactCodeAgent, HfEngine, Tool
|
|
5 |
import pandas as pd
|
6 |
|
7 |
from gradio import Chatbot
|
8 |
-
from
|
9 |
from huggingface_hub import login
|
10 |
from gradio.data_classes import FileData
|
11 |
|
@@ -20,22 +20,18 @@ agent = ReactCodeAgent(
|
|
20 |
max_iterations=10,
|
21 |
)
|
22 |
|
23 |
-
base_prompt = """You are an expert data analyst.
|
24 |
You are given a data file and the data structure below.
|
25 |
The data file is passed to you as the variable data_file, it is a pandas dataframe, you can use it directly.
|
26 |
DO NOT try to load data_file, it is already a dataframe pre-loaded in your python interpreter!
|
27 |
-
|
|
|
28 |
When importing packages use this format: from package import module
|
29 |
For example: from matplotlib import pyplot as plt
|
30 |
Not: import matplotlib.pyplot as plt
|
31 |
|
32 |
-
As you work, check for NoneType values and convert to NAN.
|
33 |
-
|
34 |
Use the data file to answer the question or solve a problem given below.
|
35 |
|
36 |
-
In your final answer: summarize your findings
|
37 |
-
After each number derive real worlds insights, for instance: "Correlation between is_december and boredness is 1.3453, which suggest people are more bored in winter".
|
38 |
-
|
39 |
Structure of the data:
|
40 |
{structure_notes}
|
41 |
|
|
|
5 |
import pandas as pd
|
6 |
|
7 |
from gradio import Chatbot
|
8 |
+
from test_streaming import stream_to_gradio
|
9 |
from huggingface_hub import login
|
10 |
from gradio.data_classes import FileData
|
11 |
|
|
|
20 |
max_iterations=10,
|
21 |
)
|
22 |
|
23 |
+
base_prompt = """You are an expert full stack data analyst.
|
24 |
You are given a data file and the data structure below.
|
25 |
The data file is passed to you as the variable data_file, it is a pandas dataframe, you can use it directly.
|
26 |
DO NOT try to load data_file, it is already a dataframe pre-loaded in your python interpreter!
|
27 |
+
When plotting using matplotlib/seaborn save the figures to the (already existing) folder'./figures/': take care to clear each figure with plt.clf() before doing another plot.
|
28 |
+
When filtering pandas dataframe use the iloc.
|
29 |
When importing packages use this format: from package import module
|
30 |
For example: from matplotlib import pyplot as plt
|
31 |
Not: import matplotlib.pyplot as plt
|
32 |
|
|
|
|
|
33 |
Use the data file to answer the question or solve a problem given below.
|
34 |
|
|
|
|
|
|
|
35 |
Structure of the data:
|
36 |
{structure_notes}
|
37 |
|
requirements.txt
CHANGED
@@ -4,6 +4,7 @@ seaborn
|
|
4 |
scikit-learn
|
5 |
scipy
|
6 |
transformers
|
7 |
-
pandas
|
8 |
huggingface_hub
|
9 |
-
|
|
|
|
4 |
scikit-learn
|
5 |
scipy
|
6 |
transformers
|
7 |
+
pandas
|
8 |
huggingface_hub
|
9 |
+
numpy
|
10 |
+
pandas
|