Skip to content

Instantly share code, notes, and snippets.

@simoninithomas
Created September 16, 2021 08:46
Show Gist options
  • Save simoninithomas/0646e46c18cf64398a1e1a1f9d16af1c to your computer and use it in GitHub Desktop.
Save simoninithomas/0646e46c18cf64398a1e1a1f9d16af1c to your computer and use it in GitHub Desktop.
HuggingFace API Part 1
public IEnumerator HFScore(string prompt)
{
// Form the JSON
var form = new Dictionary<string, object>();
var attributes = new Dictionary<string, object>();
attributes["source_sentence"] = prompt;
attributes["sentences"] = sentences;
form["inputs"] = attributes;
var json = Json.Serialize(form);
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(json);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment