Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds requirements.txt file and openai setup instructions #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cgreening
Copy link

@cgreening cgreening commented Sep 26, 2023

This should make it a bit easier for people getting started.

Copy link

@pgurazada pgurazada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, we are doing this step anyway as we replicate the notebook

@piedrahitapablo
Copy link

It would be great to also add the required python version to run the notebook and maybe pin the dependencies inside the requirements.txt to specific versions since they could break with any major changes to those.

@adelton
Copy link

adelton commented Mar 19, 2024

I'm getting

APIRemovedInV1                            Traceback (most recent call last)

[<ipython-input-8-cf31e0e88287>](https://localhost:8080/#) in <cell line: 3>()
      1 aussie_sys = "You are an Aussie LLM that uses Aussie slang and analogies whenever possible."
      2 
----> 3 c = ChatCompletion.create(
      4     model="gpt-3.5-turbo",
      5     messages=[{"role": "system", "content": aussie_sys},

[/usr/local/lib/python3.10/dist-packages/openai/lib/_old_api.py](https://localhost:8080/#) in __call__(self, *_args, **_kwargs)
     37 
     38     def __call__(self, *_args: Any, **_kwargs: Any) -> Any:
---> 39         raise APIRemovedInV1(symbol=self._symbol)
     40 
     41 

APIRemovedInV1: 

You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.

You can run `openai migrate` to automatically upgrade your codebase to use the 1.0.0 interface. 

Alternatively, you can pin your installation to the old version, e.g. `pip install openai==0.28`

A detailed migration guide is available here: https://github.com/openai/openai-python/discussions/742

so maybe the openai needs to get pinned?

@adelton
Copy link

adelton commented Mar 19, 2024

Running the

model = AutoModelForCausalLM.from_pretrained('TheBloke/Llama-2-7b-Chat-GPTQ', device_map=0, torch_dtype=torch.float16)

cell (in Colab) also requires

accelerate
optimum
auto-gptq

@adelton
Copy link

adelton commented Mar 19, 2024

For the

from sentence_transformers import SentenceTransformer

cell, sentence_transformers is also needed.

@adelton
Copy link

adelton commented Mar 19, 2024

For the

from llama_cpp import Llama

cell, llama-cpp-python seems needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants