Class: HuggingFace::BaseApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hugging_face/base_api.rb

Direct Known Subclasses

EndpointsApi, InferenceApi

Constant Summary collapse

HTTP_SERVICE_UNAVAILABLE =
503
JSON_CONTENT_TYPE =
'application/json'

Instance Method Summary collapse

Constructor Details

#initialize(api_token:) ⇒ BaseApi

Returns a new instance of BaseApi.



10
11
12
13
14
15
# File 'lib/hugging_face/base_api.rb', line 10

def initialize(api_token:)
  @headers = {
    'Authorization' => 'Bearer ' + api_token,
    'Content-Type' => JSON_CONTENT_TYPE
  }
end