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

Dockerfile for llm and service in docker compose #98

Merged
merged 15 commits into from
Feb 25, 2024
Merged

Conversation

Kleczyk
Copy link
Contributor

@Kleczyk Kleczyk commented Feb 22, 2024

To run llm you need to download the model from hugingface:

wget -P ./llm/models https://huggingface.co/TheBloke/Llama-2-7B-GGUF/resolve/main/llama-2-7b.Q3_K_L.gguf

smaller model does not work

Endpoint to send prompt

POST 127.0.0.1:9000/v1/completions
Request body

{
  "prompt": "\n\n### Instructions:\nWhat is the capital of France?\n\n### Response:\n",
  "stop": [
    "\n",
    "###"
  ]
}

Successful Response

{
  "id": "string",
  "object": "text_completion",
  "created": 0,
  "model": "string",
  "choices": [
    {
      "text": "string",
      "index": 0,
      "logprobs": {
        "text_offset": [
          0
        ],
        "token_logprobs": [
          0,
          null
        ],
        "tokens": [
          "string"
        ],
        "top_logprobs": [
          {
            "additionalProp1": 0,
            "additionalProp2": 0,
            "additionalProp3": 0
          },
          null
        ]
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0
  }
}

Validation Error

{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

@Kleczyk Kleczyk mentioned this pull request Feb 22, 2024
2 tasks
@Kleczyk Kleczyk linked an issue Feb 22, 2024 that may be closed by this pull request
2 tasks
README.md Outdated Show resolved Hide resolved
README.md Outdated
Comment on lines 78 to 80
```sh
wget https://huggingface.co/TheBloke/sheep-duck-llama-2-70B-v1.1-GGUF/resolve/main/sheep-duck-llama-2-70b-v1.1.Q4_K_S.gguf
wget -P ./llm/models https://huggingface.co/TheBloke/Llama-2-7B-GGUF/resolve/main/llama-2-7b.Q3_K_L.gguf
```
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: I'd add curl instructions as well (pro tip is -o flag) - there are systems with no curl and without wget, so this way you won't force anyone to modify the command or to install new package

llm/.gitignore Outdated Show resolved Hide resolved
llm/test/test_llm.py Outdated Show resolved Hide resolved
llm/test/test_llm.py Outdated Show resolved Hide resolved
Copy link
Member

@pgronkievitz pgronkievitz Feb 24, 2024

Choose a reason for hiding this comment

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

nitpick: this doesn't seem to be proper pytest test and it seems like kinda duplicate of test_llm file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a quick check of what llm is responding to us sometimes it can be useful

Copy link
Member

Choose a reason for hiding this comment

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

does it have any advantage over running regular test doing exactly the same?

llm/test/test_llm.py Show resolved Hide resolved
@Kleczyk Kleczyk requested a review from pgronkievitz February 24, 2024 12:09
Copy link
Member

@pgronkievitz pgronkievitz left a comment

Choose a reason for hiding this comment

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

in general lgtm

README.md Outdated
Comment on lines 78 to 80
```sh
wget https://huggingface.co/TheBloke/sheep-duck-llama-2-70B-v1.1-GGUF/resolve/main/sheep-duck-llama-2-70b-v1.1.Q4_K_S.gguf
curl -o ./llm/models/llama-2-7b.Q3_K_L.gguf -L https://huggingface.co/TheBloke/Llama-2-7B-GGUF/resolve/main/llama-2-7b.Q3_K_L.gguf
```
Copy link
Member

Choose a reason for hiding this comment

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

suggestion (non-blocking): please add both instructions with curl and wget

@Kleczyk Kleczyk merged commit 5344c0e into main Feb 25, 2024
2 checks passed
@Kleczyk Kleczyk deleted the Dockerfile_for_LLM branch February 25, 2024 10:44
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.

Postawienie LLMa
2 participants