Update README.md
Browse files
README.md
CHANGED
@@ -8,30 +8,3 @@ tags:
|
|
8 |
- text-to-plot
|
9 |
- pandas-to-plot
|
10 |
---
|
11 |
-
# Import basis libraries
|
12 |
-
import pandas as pd
|
13 |
-
import pandasai as pdai
|
14 |
-
from pandasai import PandasAI
|
15 |
-
|
16 |
-
from pandasai.llm.starcoder import Starcoder
|
17 |
-
# Define List of Models
|
18 |
-
|
19 |
-
models = {"Starcoder": Starcoder}
|
20 |
-
|
21 |
-
#@title Select Model to Run
|
22 |
-
model_to_run = 'Starcoder' #@param [ "Starcoder", "Open-Assistant"]
|
23 |
-
#print(f"Enter API for {model_to_run} platform")
|
24 |
-
|
25 |
-
# Enter API Key
|
26 |
-
API_KEY = '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'#@param {type:"string"}
|
27 |
-
pd.DataFrame({
|
28 |
-
"country": ["United States", "United Kingdom", "France", "Germany", "Italy", "Spain", "Canada", "Australia", "Japan", "China"],
|
29 |
-
"gdp": [21400000, 2940000, 2830000, 3870000, 2160000, 1350000, 1780000, 1320000, 516000, 14000000],
|
30 |
-
"happiness_index": [7.3, 7.2, 6.5, 7.0, 6.0, 6.3, 7.3, 7.3, 5.9, 5.0]
|
31 |
-
# Model Initialisation
|
32 |
-
llm = models[model_to_run](api_token=API_KEY)
|
33 |
-
pandas_ai = PandasAI(llm, conversational=False, verbose=True)
|
34 |
-
# Enter Prompt related to data or Select from Pre-defined for demo purposes.
|
35 |
-
prompt = 'Plot the histogram of countries showing for each the gpd, using different colors for each bar' #@param [ "What is the relation between GDP and Happines Index", "Plot the histogram of countries showing for each the gpd, using different colors for each bar", "GDP of Top 5 Happiest Countries?"] {allow-input: true}
|
36 |
-
response = pandas_ai.run(df, prompt=prompt,
|
37 |
-
is_conversational_answer=False)
|
|
|
8 |
- text-to-plot
|
9 |
- pandas-to-plot
|
10 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|