darkBERT

#6
by hamirii - opened

I got the darkBERT access. I am trying to learn how to use it. The errors are giving me a hard time. I also dont know if I am able to get detailed responses. Let us see, let me know if you have any suggestion, or am I missing anything.

You are very lucky. I try but unable to get it's access. I don't what kind of errors your are facing. If you need any help let me know. I try my best

Hey,
you can use the model via the Inference API for example ("Deploy" > "Inference API").
The provided python example may help you:

import requests

API_URL = "https://api-inference.huggingface.co/models/s2w-ai/DarkBERT"
headers = {"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxx"} # replace with AT from "Profile" > "Settings" > "Acccess Token"

def query(payload):
    response = requests.post(API_URL, headers=headers, json=payload)
    return response.json()
    
output = query({
    "inputs": "The answer to the universe is <mask>.",
})

print(output)

The model will then predict values for <mask>.

Hope this helps.

Sign up or log in to comment