Class: LlmLib::HuggingfaceApiClient

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

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ HuggingfaceApiClient

Returns a new instance of HuggingfaceApiClient.



64
65
66
# File 'lib/llm_lib.rb', line 64

def initialize(api_key)
    @api_key = api_key
end

Instance Method Details

#hugging_bloom_call(query, model = "bigscience/bloom") ⇒ Object



68
69
70
71
72
73
74
# File 'lib/llm_lib.rb', line 68

def hugging_bloom_call(query, model = "bigscience/bloom")
    response = HuggingFace.send(@api_key,
                            model,
                            query 
                            )
    response
end

#hugging_dolly2_call(query, model = "databricks/dolly-v2-12b") ⇒ Object



90
91
92
93
94
95
96
# File 'lib/llm_lib.rb', line 90

def hugging_dolly2_call(query, model = "databricks/dolly-v2-12b")
    response = HuggingFace.send(@api_key,
                            model,
                            query 
                            )
    response
end

#hugging_falcon_call(query, model = "tiiuae/falcon-40b-instruct") ⇒ Object



76
77
78
79
80
81
# File 'lib/llm_lib.rb', line 76

def hugging_falcon_call(query, model = "tiiuae/falcon-40b-instruct")
    response = HuggingFace.send(@api_key,
                            model, 
                            query)
    response
end

#hugging_flant5_call(query, model = "google/flan-t5-xl") ⇒ Object



98
99
100
101
102
103
104
# File 'lib/llm_lib.rb', line 98

def hugging_flant5_call(query, model = "google/flan-t5-xl")
    response = HuggingFace.send(@api_key,
                            model,
                            query 
                            )
    response
end

#hugging_llama2_call(query, model = "meta-llama/Llama-2-70b-chat-hf") ⇒ Object



83
84
85
86
87
88
# File 'lib/llm_lib.rb', line 83

def hugging_llama2_call(query, model = "meta-llama/Llama-2-70b-chat-hf")
    response = HuggingFace.send(@api_key,
                            model, 
                            query)
    response
end