Skip to content

Commit

Permalink
Add Mistral Codestral
Browse files Browse the repository at this point in the history
  • Loading branch information
svilupp committed May 29, 2024
1 parent 8735c07 commit 6748018
Show file tree
Hide file tree
Showing 1,410 changed files with 1,416 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

[compat]
PromptingTools = "0.25"
PromptingTools = "0.27"
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ Remember that the benchmark is quite challenging for any model - a single extra
### Paid APIs

Across the board, Claude 3 and GPT-4 are the best-performing models. The real surprise is the performance of Claude 3 Haiku which is 50-100x cheaper than Claude 3 Opus but still beats GPT-4.
The latest GPT3.5-Turbo (0125) scores very well - in many cases, it's as good as GPT-4 Turbo, yet it's much cheaper and faster (see the deep-dive in the docs)!
"mistral-small" ("Mixtral 8x7B" model) is quite impressive, as it beats many of the GPT-3.5 Turbo in many cases.
The latest Mistral model - codestral - is quite impressive (it's very fast as well).

| Model | Elapsed | Score | Score Std Deviation | Count Zero Score | Count Full Score | Cost Cents |
|--------------------------|---------|-------|---------------------|------------------|------------------|------------|
| claude-3-opus-20240229 | 20.3 | 83.2 | 19.6 | 2 | 329 | 3.9 |
| claude-3-sonnet-20240229 | 8.7 | 78.8 | 26.2 | 22 | 308 | 0.73 |
| codestral-2405 | 1.9 | 76.3 | 29.3 | 33 | 276 | 0.0 |
| gpt-4-turbo-2024-04-09 | 10.8 | 75.3 | 29.6 | 38 | 290 | 1.38 |
| claude-3-haiku-20240307 | 4.0 | 74.9 | 27.2 | 9 | 261 | 0.05 |
| gpt-4-0125-preview | 30.3 | 74.4 | 30.3 | 39 | 284 | 1.29 |
Expand All @@ -82,7 +82,6 @@ The latest GPT3.5-Turbo (0125) scores very well - in many cases, it's as good as




Note: From mid-February 2024, "gpt-3.5-turbo" will point to the latest release, "gpt-3.5-turbo-0125" (deprecating the June release).

Same information, but as a bar chart:
Expand Down
Binary file modified assets/cost-vs-score-scatter-paid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/elapsed-vs-score-scatter-paid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/model-comparison-paid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/model-prompt-comparison-paid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Sure, here is a simple function in Julia that does what you asked for. It uses the `Dates` package to extract the year and month from the DateTime objects, and then concatenates them together as a string, which is then converted to an integer.\n\n```julia\nusing DataFrames, Dates\n\nfunction add_yearmonth(df)\n df[:ym] = [parse(Int, Dates.format(dt, \"yyyymm\")) for dt in df[:dt]]\n return df\nend\n```\n\nThis function assumes that your DataFrame is named `df` and that the column with DateTime objects is named `dt`. It creates a new column in `df` called `ym`. If `dt` does not exist or is not of DateTime type, this function may not work as expected.","status":200,"tokens":[75,181],"elapsed":1.298398458,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":-1781117030,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Sure, here is a function in Julia that should do what you're asking for. This function uses the `Dates` package to extract the year and month from each DateTime in the `dt` column and then formats them into the required format \"yyyymm\".\n\n```julia\nusing DataFrames, Dates\n\nfunction add_yearmonth(df::DataFrame)\n df[:ym] = [Dates.format(date, \"yyyymm\") for date in df[:dt]]\n df[:ym] = [parse(Int, ym) for ym in df[:ym]]\n return df\nend\n```\n\nThis function first creates a new column `ym` in the DataFrame `df`. It then fills this column with the year and month of each DateTime in the `dt` column. Finally, it converts the year and month strings to integers.","status":200,"tokens":[75,198],"elapsed":1.426778833,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":403767244,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Sure, here is a simple function in Julia that does what you asked for:\n\n```julia\nusing DataFrames\n\nfunction add_yearmonth!(df::DataFrame)\n df[!, :ym] = Dates.format.(df.dt, \"yyyymm\") .|> (x -> parse(Int, x))\n return df\nend\n```\n\nThis function modifies the DataFrame `df` by adding a new column `ym`. It first uses the `Dates.format` function to convert the `dt` column into a string with the format \"yyyymm\". Then, it converts that string into an integer using the `parse` function. The `.|>` operator is used to pipe the result of the previous operation into the next one.\n\nNote: This function modifies `df` in-place. If you want to keep `df` unchanged, you can create a copy of `df` before modifying it.","status":200,"tokens":[75,216],"elapsed":1.547008125,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":1496527487,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Sure! I can help you with that. Here's a function `add_yearmonth` that extracts the year and month from the `dt` column of a given DataFrame `df` and concatenates them together as an integer in the format \"yyyymm\":\n\n```julia\nusing DataFrames\n\nfunction add_yearmonth(df)\n df[:ym] = [Dates.yearmonth(date) for date in df[:dt]]\n df[:ym] = [Dates.year(ym) * 100 + Dates.month(ym) for ym in df[:ym]]\n return df\nend\n```\n\nYou can call this function with your DataFrame `df` as an argument to add the `ym` column:\n\n```julia\ndf = add_yearmonth(df)\n```\n\nThis will update `df` by adding a new column `ym` with the year and month values in the desired format.","status":200,"tokens":[75,221],"elapsed":1.610573,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":358922528,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Here is a function `add_yearmonth` in Julia that accomplishes what you described:\n\n```julia\nusing Dates\nusing DataFrames\n\nfunction add_yearmonth(df)\n df[:ym] = Dates.yearmonth.(df[:dt]) # Extract year and month\n df[:ym] = .*100.(Dates.year.(df[:ym])) .+ Dates.month.(df[:ym]) # Concatenate as integer\n return df\nend\n```\n\nThis function first uses the `Dates.yearmonth` function to extract the year and month from each `DateTime` in the `dt` column. It then uses the `Dates.year` and `Dates.month` functions to separately extract the year and month from this `YearMonth` object. Each year is multiplied by 100 to make room for the month, and then the month is added. The result is a new `ym` column in the `df` DataFrame containing the desired year-month integers.","status":200,"tokens":[75,232],"elapsed":1.633106,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":1221756366,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Sure! I can help you with that. Here's a function `add_yearmonth` that you can use in Julia to create a new column `ym` by extracting the year and month from the `dt` column of a DataFrame `df` and concatenating them together as an integer in the format \"yyyymm\":\n\n```julia\nusing DataFrames\nusing Dates\n\nfunction add_yearmonth(df)\n df[!, :ym] = [Dates.year(dt) * 100 + Dates.month(dt) for dt in df.dt]\n return df\nend\n```\n\nThis function uses list comprehension to iterate over each datetime in the `dt` column, extracts the year and month using the `Dates.year` and `Dates.month` functions from the `Dates` package, and then concatenates them together using the `*` operator. The resulting integer is then added as a new column `ym` to the DataFrame.","status":200,"tokens":[75,228],"elapsed":1.597352875,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":873892226,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Sure, I can help with that. In Julia, you can use the `Dates` package to extract the year and month from a datetime. Here's a function that does what you're asking for:\n\n```julia\nusing DataFrames, Dates\n\nfunction add_yearmonth(df::DataFrame)\n df[!, :ym] = map(x -> parse(Int, Dates.format(x, \"yyyymm\")), df[!, :dt])\n return df\nend\n```\n\nThis function takes a DataFrame `df` as input. It creates a new column `ym` in the DataFrame by applying a transformation to each element of the `dt` column. The transformation is defined by the anonymous function `x -> parse(Int, Dates.format(x, \"yyyymm\"))`. This function formats the datetime `x` as a string in the format \"yyyymm\", and then converts that string to an integer. The results are stored in the new `ym` column.\n\nRemember to include the `DataFrames` and `Dates` packages at the beginning of your Julia script. If they're not already installed, you can add them to your Julia environment using the package manager.","status":200,"tokens":[75,278],"elapsed":1.936772208,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":374522599,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Here is a function that does that:\n\n```julia\nusing DataFrames\n\nfunction add_yearmonth(df)\n df[:ym] = map(x->parse(Int, Dates.format(x, \"yyyymm\")), df[:dt])\n return df\nend\n```\n\nThis function uses the Dates package to convert each datetime in the `dt` column to the required format \"yyyymm\". The `map` function applies this conversion to each element of the `dt` column. The resulting array is then assigned to the new `ym` column of the DataFrame. Finally, the updated DataFrame is returned.\n\nNote: This function assumes that `dt` contains `DateTime` objects. If `dt` contains `Date` objects, you should use `\"yyyymm\"` in the `format` function instead of `\"yyyymmdd\"`.","status":200,"tokens":[75,200],"elapsed":1.443978417,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":1950452879,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Sure, here is a simple function that does that in Julia using the DataFrames and Dates libraries:\n\n```julia\nusing DataFrames, Dates\n\nfunction add_yearmonth(df::DataFrame)\n df[:ym] = [Dates.yearmonth(dt).value for dt in df[:dt]]\n return df\nend\n```\n\nThis function adds a new column to the DataFrame `df` named `ym`. It iterates over each element in the `dt` column, extracts the year and month using the `Dates.yearmonth(dt).value` function, and assigns the result to the corresponding row in the `ym` column. Finally, it returns the modified DataFrame.","status":200,"tokens":[75,161],"elapsed":1.168654416,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":-1439526611,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"Act as a helpful AI assistant","variables":[],"_type":"systemmessage"},{"content":"In Julia, Given a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":[],"_type":"usermessage"},{"content":"Here is a function `add_yearmonth` that should do the trick:\n\n```julia\nusing DataFrames\nusing Dates\n\nfunction add_yearmonth(df)\n df[!, :ym] = Dates.year.(df[!, :dt]) .* 100 .+ Dates.month.(df[!, :dt])\n return df\nend\n```\n\nThis function uses the `Dates.year` and `Dates.month` functions to extract the year and month from each DateTime in the `dt` column. The year is multiplied by 100 and then the month is added to create a new integer in the \"yyyymm\" format. The new column is then added to the DataFrame `df` and the updated DataFrame is returned.","status":200,"tokens":[75,181],"elapsed":1.333681333,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":515822223,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"You are a world-class Julia language programmer with the knowledge of the latest syntax. Your communication is brief and concise. You're precise and answer only when you're confident in the high quality of your answer.","variables":[],"_type":"systemmessage"},{"content":"# Question\n\nGiven a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":["ask"],"_type":"usermessage"},{"content":"```julia\nusing DataFrames\n\nfunction add_yearmonth(df)\n df[:ym] = Dates.yearmonth.(df[:dt]) .|> ym -> Int(ym)\nend\n```\n\nThis function adds a new column `ym` to the DataFrame `df` by transforming the `dt` column. It uses the `Dates.yearmonth` function to extract the year and month from the date-time value, then converts this value to an `Int`. The `.|>` operator is used to pipe the result of the transformation into the `Int` constructor.","status":200,"tokens":[117,135],"elapsed":0.991045625,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":477477692,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"You are a world-class Julia language programmer with the knowledge of the latest syntax. Your communication is brief and concise. You're precise and answer only when you're confident in the high quality of your answer.","variables":[],"_type":"systemmessage"},{"content":"# Question\n\nGiven a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":["ask"],"_type":"usermessage"},{"content":"Here's a function in Julia that does that:\n\n```julia\nusing DataFrames\n\nfunction add_yearmonth!(df::DataFrame)\n df[:ym] = map(x -> parse(Int, Dates.format(x, \"yyyymm\")), df[:dt])\nend\n```\n\nThis function will add a new column `:ym` to the DataFrame `df`. It uses the `map` function to apply the anonymous function `x -> parse(Int, Dates.format(x, \"yyyymm\"))` to each element of the `:dt` column. The anonymous function formats a DateTime as a string in \"yyyymm\" format and then parses that string as an integer.","status":200,"tokens":[117,165],"elapsed":1.1953535,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":1545195167,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"You are a world-class Julia language programmer with the knowledge of the latest syntax. Your communication is brief and concise. You're precise and answer only when you're confident in the high quality of your answer.","variables":[],"_type":"systemmessage"},{"content":"# Question\n\nGiven a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":["ask"],"_type":"usermessage"},{"content":"```julia\nusing Dates\n\nfunction add_yearmonth(df)\n df[:ym] = [Dates.yearmonth(x) for x in df[:dt]] .|> y -> 100 * y.year + y.month\n return df\nend\n```\n\nThis function takes a DataFrame `df` as an argument. It creates a new column `ym` which is an integer representation of the year and month extracted from the `dt` column. The year and month are concatenated together as \"yyyymm\" format. The function returns the modified DataFrame.","status":200,"tokens":[117,134],"elapsed":1.024687458,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":313558587,"sample_id":null,"_type":"aimessage"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"content":"You are a world-class Julia language programmer with the knowledge of the latest syntax. Your communication is brief and concise. You're precise and answer only when you're confident in the high quality of your answer.","variables":[],"_type":"systemmessage"},{"content":"# Question\n\nGiven a DataFrame `df` with column `dt` representing DateTimes. Write a function `add_yearmonth` that creates a new column `ym` by extracting year and month from `dt` and concatenating them together as an integer in format: “yyyymm”.","variables":["ask"],"_type":"usermessage"},{"content":"```julia\nusing DataFrames\n\nfunction add_yearmonth(df)\n df[:ym] = Dates.yearmonth.(df[:dt]) .|> Dates.format .|> x -> parse(Int, x)\n return df\nend\n```\n\nThis function uses the `Dates` module to extract the year and month from each `DateTime` in the `dt` column. The `yearmonth` function extracts the year and month, the `format` function converts this to a string in \"yyyymm\" format, and finally `parse(Int, x)` converts this string to an integer. The result is a new column `ym` in `df`.","status":200,"tokens":[117,156],"elapsed":1.144423708,"cost":0.0,"log_prob":null,"finish_reason":"stop","run_id":-1336010899,"sample_id":null,"_type":"aimessage"}]
Loading

0 comments on commit 6748018

Please sign in to comment.