Created
September 16, 2021 08:46
-
-
Save simoninithomas/0646e46c18cf64398a1e1a1f9d16af1c to your computer and use it in GitHub Desktop.
HuggingFace API Part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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