Skip to content

Instantly share code, notes, and snippets.

@MarioAriasC
Last active November 26, 2024 17:10
Show Gist options
  • Select an option

  • Save MarioAriasC/599204342860a161d4fe12b12f0d3de9 to your computer and use it in GitHub Desktop.

Select an option

Save MarioAriasC/599204342860a161d4fe12b12f0d3de9 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
# install this gem first
require 'unicode_plot'
require 'json'
hf_json = JSON.parse(File.read(ARGV[0]))
hf_results = hf_json["results"]
hf_barplot_data = {}
hf_results.each do |result|
command = result["command"]
hf_barplot_data[command] = result["mean"]
end
UnicodePlot.barplot(width: 100, data: hf_barplot_data, title: "").render
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment