lamini-ai / lamini

Apache License 2.0
2.5k stars 155 forks source link

TypeError: Lamini.__init__() got an unexpected keyword argument 'local_cache_file' #68

Closed valiantone closed 1 month ago

valiantone commented 1 month ago

Your push on Thursday has completely broken the API service, by adding an illegal variable in the constructor.

Code to re-create:

import lamini
mod = lamini.LlamaV3Runner(model_name="mistralai/Mistral-7B-In-v0.2")

Breaks right there!

Trace:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[6], line 1
----> 1 mod = lamini.runners.llama_v2_runner.LlamaV2Runner()

File ~/forge/.wvss/lib/python3.10/site-packages/lamini/runners/llama_v2_runner.py:25, in LlamaV2Runner.__init__(self, model_name, system_prompt, prompt_template, api_key, api_url, config, local_cache_file)
     15 def __init__(
     16     self,
     17     model_name: str = "meta-llama/Meta-Llama-3.1-8B-Instruct",
   (...)
     23     local_cache_file=None,
     24 ):
---> 25     super().__init__(
     26         config=config,
     27         # important to only check None to allow "" empty system prompt
     28         system_prompt=(
     29             DEFAULT_SYSTEM_PROMPT if (system_prompt is None) else system_prompt
     30         ),
     31         model_name=model_name,
     32         prompt_template=prompt_template,
     33         api_key=api_key,
     34         api_url=api_url,
     35         local_cache_file=local_cache_file,
     36     )

File ~/forge/.wvss/lib/python3.10/site-packages/lamini/runners/base_runner.py:21, in BaseRunner.__init__(self, model_name, system_prompt, prompt_template, api_key, api_url, config, local_cache_file)
     19 self.config = config
     20 self.model_name = model_name
---> 21 self.lamini_api = Lamini(
     22     model_name=model_name,
     23     api_key=api_key,
     24     api_url=api_url,
     25     local_cache_file=local_cache_file,
     26 )
     27 self.prompt_template = prompt_template
     28 self.system_prompt = system_prompt

TypeError: Lamini.__init__() got an unexpected keyword argument 'local_cache_file'
valiantone commented 1 month ago

Solved

I guess V3Runners and V2Runners are no longer supported in latest release, everything is through the lamini.api.Lamini() interface.

@greg1232 request for more constant updates on documentation page please! Timely updates could really help us out a lot, since your team is not following any kind of backward compatible API design.