lamini-ai / lamini

Apache License 2.0
2.5k stars 155 forks source link

ModelNameError: Not Found in Lamini: Finetuning for Free.ipynb colab #35

Closed donbale closed 7 months ago

donbale commented 7 months ago

Hi,

I get this error:

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/llama/program/util/run_ai.py](https://localhost:8080/#) in powerml_send_query_to_url(params, route)
    133         )
--> 134         response.raise_for_status()
    135     except requests.exceptions.Timeout:

6 frames
[/usr/local/lib/python3.10/dist-packages/requests/models.py](https://localhost:8080/#) in raise_for_status(self)
   1020         if http_error_msg:
-> 1021             raise HTTPError(http_error_msg, response=self)
   1022 

HTTPError: 404 Client Error: Not Found for url: https://api.powerml.co/v1/llama/data

During handling of the above exception, another exception occurred:

ModelNameError                            Traceback (most recent call last)
[<ipython-input-4-de718df47cc0>](https://localhost:8080/#) in <cell line: 3>()
      1 # Train the model
      2 start=time.time()
----> 3 finetune_model.train(enable_peft=True)
      4 print(f"Time taken: {time.time()-start} seconds")

[/usr/local/lib/python3.10/dist-packages/llama/runners/question_answer_runner.py](https://localhost:8080/#) in train(self, verbose, finetune_args, enable_peft, peft_args, limit)
    118         else:
    119             qa_pairs = self.question_answer
--> 120         self.llm.save_data(qa_pairs)
    121 
    122         final_status = self.llm.train(task="question_answer", verbose=verbose, finetune_args=finetune_args, enable_peft=enable_peft, peft_args=peft_args)

[/usr/local/lib/python3.10/dist-packages/llama/program/builder.py](https://localhost:8080/#) in save_data(self, data)
    365         self.program.examples = []
    366         self.program.add_data(examples=data)
--> 367         results = gen_submit_data(self.program, self.id)
    368         return results
    369 

[/usr/local/lib/python3.10/dist-packages/llama/program/util/api_actions.py](https://localhost:8080/#) in gen_submit_data(program, id)
    138         "data": program["examples"],
    139     }
--> 140     response = query_submit_data(params)
    141     response.raise_for_status()
    142     return response.json()

[/usr/local/lib/python3.10/dist-packages/llama/program/util/run_ai.py](https://localhost:8080/#) in query_submit_data(params)
     83 
     84 def query_submit_data(params):
---> 85     resp = powerml_send_query_to_url(params, "/v1/llama/data")
     86     return resp
     87 

[/usr/local/lib/python3.10/dist-packages/llama/program/util/run_ai.py](https://localhost:8080/#) in powerml_send_query_to_url(params, route)
    137     except requests.exceptions.HTTPError as e:
    138         if response.status_code == 404:
--> 139             raise llama.error.ModelNameError(
    140                 response.json().get("detail", "ModelNameError")
    141             )

ModelNameError: Not Found

at this step of the notebook:

# Train the model
start=time.time()
finetune_model.train(enable_peft=True)
print(f"Time taken: {time.time()-start} seconds")

I have tried adding another model name but with the same result, is it an issue my end or possibly with the API?

edamamez commented 7 months ago

Hello! Thank you for reaching out. The notebook is outdated.

Please consider looking at our SDK's (https://github.com/lamini-ai/lamini-sdk) or docs (https://lamini-ai.github.io/) to get started! This is the section on training: https://lamini-ai.github.io/training/quick_tour/