sxd3125 commited on
Commit
aa6deca
β€’
1 Parent(s): ebb7dc7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -31
app.py CHANGED
@@ -5,11 +5,8 @@ from pandasai.llm.starcoder import Starcoder
5
  import matplotlib.pyplot as plt
6
  import gradio as gr
7
 
8
- def plot_chey():
9
- a,b = plt.subplots()
10
-
11
- plt.xlabel('two rs')
12
- plt.title('hada')
13
  return a
14
 
15
  title='Plot'
@@ -35,34 +32,14 @@ prompt = 'Plot the histogram of countries showing for each the gdp, using differ
35
  response = pandas_ai.run(df, prompt=prompt,
36
  is_conversational_answer=False)
37
 
38
- heading = 'πŸ€—πŸ§‘πŸ€πŸ’™ Plot different SVM Classifiers on Iris Dataset'
39
  with gr.Blocks(title = heading, theme= 'snehilsanyal/scikit-learn') as demo:
40
  gr.Markdown("# {}".format(heading))
41
- gr.Markdown(
42
- """
43
- ### This demo visualizes different SVM Classifiers on a 2D projection of the Iris dataset.
44
-
45
- <b>The features to be considered are:</b>\
46
- \
47
-
48
- 1. Sepal length (cm) \
49
-
50
- 2. Sepal width (cm) \
51
-
52
- <b>The SVM Classifiers used for this demo are:</b>\
53
- \
54
- 1. SVC with linear kernel \
55
-
56
- 2. Linear SVC \
57
-
58
- 3. SVC with RBF kernel\
59
-
60
- 4. SVC with Polynomial (degree 3) kernel
61
- """
62
- )
63
- gr.Markdown('**[Demo is based on this script from scikit-learn documentation](https://scikit-learn.org/stable/auto_examples/svm/plot_iris_svc.html#sphx-glr-auto-examples-svm-plot-iris-svc-py)**')
64
- button = gr.Button(value = 'Visualize different SVM Classifiers on Iris Dataset')
65
- button.click(plot_chey, outputs = gr.Plot())
66
 
67
  demo.launch()
68
  """
 
5
  import matplotlib.pyplot as plt
6
  import gradio as gr
7
 
8
+ def plot_chey(X):
9
+ a,b = X.figure, X.axes
 
 
 
10
  return a
11
 
12
  title='Plot'
 
32
  response = pandas_ai.run(df, prompt=prompt,
33
  is_conversational_answer=False)
34
 
35
+ heading = 'Pandas AI : Dataframe analytics using text prompt'
36
  with gr.Blocks(title = heading, theme= 'snehilsanyal/scikit-learn') as demo:
37
  gr.Markdown("# {}".format(heading))
38
+
39
+
40
+
41
+ button = gr.Button(value = 'submit')
42
+ button.click(plot_chey(response), outputs = gr.Plot())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  demo.launch()
45
  """