qt-spyro-hf commited on
Commit
3c62cd1
·
verified ·
1 Parent(s): 2114a2d

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -20
README.md CHANGED
@@ -10,16 +10,25 @@ tags:
10
  # Model Overview
11
 
12
  ## Description:
13
- CodeLlama-13B-QML is a large language model customized by the Qt Company for Fill-In-The-Middle code completion tasks in the QML programming language, especially for Qt Quick Controls compliant with Qt 6 releases. The CodeLlama-13B-QML model is designed for companies and individuals who want to self-host their LLM for HMI (Human Machine Interface) software development instead of relying on third-party hosted LLMs.
14
 
15
- This model reaches a score of 86% on the QML100 Fill-In-the-Middle code completion benchmark for Qt 6-compliant code. In comparison, CodeLlama-7B-QML (finetuned model from Qt) scored 79%, Claude 3.7 Sonnet scored 76%, Claude 3.5 Sonnet scored 68%, the base CodeLlama-13B scored 66%, GPT-4o scored 62%, and CodeLlama-7B scored 61%. This model was fine-tuned based on raw data from over 5000 human-created QML code snippets using the LoRa fine-tuning method. CodeLlama-13B-QML is not optimised for the creation of Qt5-release compliant, C++, or Python code.
 
 
 
 
 
 
 
 
 
16
 
17
  ## Terms of use:
18
  By accessing this model, you are agreeing to the Llama 2 terms and conditions of the [license](https://github.com/meta-llama/llama/blob/main/LICENSE), [acceptable use policy](https://github.com/meta-llama/llama/blob/main/USE_POLICY.md) and [Meta’s privacy policy](https://www.facebook.com/privacy/policy/). By using this model, you are furthermore agreeing to the [Qt AI Model terms & conditions](https://www.qt.io/terms-conditions/ai-services/model-use).
19
 
20
  ## Usage:
21
 
22
- CodeLlama-13B-QML is a medium-sized Language Model that requires significant computing resources to perform with inference (response) times suitable for automatic code completion. Therefore, it should be used with a GPU accelerator, either in a cloud environment such as AWS, Google Cloud, Microsoft Azure, or locally.
23
 
24
  Large Language Models, including CodeLlama-13B-QML, are not designed to be deployed in isolation but instead should be deployed as part of an overall AI system with additional safety guardrails as required. Developers are expected to deploy system safeguards when building AI systems.
25
 
@@ -29,44 +38,37 @@ The repository contains multiple files with adapters.
29
 
30
  The configuration depends on the chosen cloud technology.
31
 
32
- Running a CodeLlama-13b-QML in the cloud requires working with Docker and vLLM for optimal performance. Make sure all required dependencies are installed (transformers, accelerate and peft modules). Use bfloat16 precision. The setup leverages the base model from Hugging Face (requiring an access token) combined with adapter weights from the repository. Using vLLM enables efficient inference with an OpenAI-compatible API endpoint, making integration straightforward. vLLM serves as a highly optimized backend that implements request batching and queuing mechanisms, providing excellent serving optimization. The docker container should be run on an instance with GPU accelerator. The configuration has been thoroughly tested on Ubuntu 22.04 LTS running NVIDIA driver with A100 80GB GPUs, demonstrating stable and efficient performance.
33
 
34
  ## How to run CodeLlama-13B-QML in ollama:
35
 
36
- #### 1. Install ollama
37
- https://ollama.com/download
38
-
39
- #### 2. Clone the model repository
40
 
41
- #### 3. Open the terminal and go to the repository
42
-
43
- #### 4. Build the model in ollama
44
  ```
45
- ollama create codellama:13b-code-qml -f Modelfile
46
  ```
47
- The model's name must be exactly as above if one wants to use the model in the Qt Creator
48
 
49
- #### 5. Run the model
50
  ```
51
- ollama run codellama:13b-code-qml
52
  ```
53
- You can start writing prompts in the terminal or send curl requests now.
54
 
55
- Here is a curl request example:
56
  ```
57
  curl -X POST http://localhost:11434/api/generate -d '{
58
- "model": "codellama:13b-code-qml",
59
  "Prompt": "<SUF>\n title: qsTr(\"Hello World\")\n}<PRE>import QtQuick\n\nWindow {\n width: 640\n height: 480\n visible: true\n<MID>",
60
  "stream": false,
61
  "temperature": 0,
62
  "top_p": 0.9,
63
  "repeat_penalty": 1.1,
64
- "num_predict": 300,
65
  "stop": ["<SUF>", "<PRE>", "</PRE>", "</SUF>", "< EOT >", "\\end", "<MID>", "</MID>", "##"]
66
  }'
67
  ```
68
 
69
- The prompt format:
70
  ```
71
  "<SUF>{suffix}<PRE>{prefix}<MID>"
72
  ```
@@ -76,6 +78,9 @@ If there is no suffix, please use:
76
  "<PRE>{prefix}<MID>"
77
  ```
78
 
 
 
 
79
 
80
  ## Model Version:
81
  v2.0
 
10
  # Model Overview
11
 
12
  ## Description:
13
+ CodeLlama-13B-QML is a large language model customized by the Qt Company for Fill-In-The-Middle code completion tasks in the QML programming language, especially for Qt Quick Controls compliant with Qt 6 releases. The CodeLlama-13B-QML model is designed for companies and individuals that want to self-host their LLM for HMI (Human Machine Interface) software development instead of relying on third-party hosted LLMs. It can by done via cloud services or locally, via Ollama.
14
 
15
+ This model reaches a score of 79% on the QML100 Fill-In-the-Middle code completion benchmark for Qt 6-compliant code. In comparison, other models scored:
16
+
17
+ CodeLlama-7B-QML: 79%
18
+ Claude 3.7 Sonnet: 76%
19
+ Claude 3.5 Sonnet: 68%
20
+ CodeLlama 13B: 66%
21
+ GPT-4o: 62%
22
+ CodeLlama 7B: 61%
23
+
24
+ This model was fine-tuned based on raw data from over 5000 human-created QML code snippets using the LoRa fine-tuning method. CodeLlama-13B-QML is not optimised for the creation of Qt5-release compliant, C++, or Python code.
25
 
26
  ## Terms of use:
27
  By accessing this model, you are agreeing to the Llama 2 terms and conditions of the [license](https://github.com/meta-llama/llama/blob/main/LICENSE), [acceptable use policy](https://github.com/meta-llama/llama/blob/main/USE_POLICY.md) and [Meta’s privacy policy](https://www.facebook.com/privacy/policy/). By using this model, you are furthermore agreeing to the [Qt AI Model terms & conditions](https://www.qt.io/terms-conditions/ai-services/model-use).
28
 
29
  ## Usage:
30
 
31
+ CodeLlama-13B-QML is a medium-sized Language Model that requires significant computing resources to perform with inference (response) times suitable for automatic code completion. Therefore, it should be used with a GPU accelerator, either in the cloud environment such as AWS, Google Cloud, Microsoft Azure, or locally.
32
 
33
  Large Language Models, including CodeLlama-13B-QML, are not designed to be deployed in isolation but instead should be deployed as part of an overall AI system with additional safety guardrails as required. Developers are expected to deploy system safeguards when building AI systems.
34
 
 
38
 
39
  The configuration depends on the chosen cloud technology.
40
 
41
+ Running a CodeLlama-13B-QML in the cloud requires working with Docker and vLLM for optimal performance. Make sure all required dependencies are installed (transformers, accelerate and peft modules). Use bfloat16 precision. The setup leverages the base model from Hugging Face (requiring an access token) combined with adapter weights from the repository. Using vLLM enables efficient inference with an OpenAI-compatible API endpoint, making integration straightforward. vLLM serves as a highly optimized backend that implements request batching and queuing mechanisms, providing excellent serving optimization. The docker container should be run on an instance with GPU accelerator. The configuration has been thoroughly tested on Ubuntu 22.04 LTS running NVIDIA driver with A100 80GB GPUs, demonstrating stable and efficient performance.
42
 
43
  ## How to run CodeLlama-13B-QML in ollama:
44
 
45
+ We have preloaded the model to Ollama for your convenience.
 
 
 
46
 
47
+ #### 1. Download and install Ollama from Ollama's web page (if you are not using it yet):
 
 
48
  ```
49
+ https://ollama.com/download
50
  ```
 
51
 
52
+ #### 2. Run the model with the following command in Ollama's CLI:
53
  ```
54
+ ollama run theqtcompany/codellama-13b-qml
55
  ```
56
+ Now, you can set and use CodeLlama-13B-QML as an LLM for code completions in the Qt AI Assistant or other coding assistants. If you want to test the model in Ollama, then you can write curl requests in Ollama's CLI, as shown below.
57
 
 
58
  ```
59
  curl -X POST http://localhost:11434/api/generate -d '{
60
+ "model": "theqtcompany/codellama-13b-qml",
61
  "Prompt": "<SUF>\n title: qsTr(\"Hello World\")\n}<PRE>import QtQuick\n\nWindow {\n width: 640\n height: 480\n visible: true\n<MID>",
62
  "stream": false,
63
  "temperature": 0,
64
  "top_p": 0.9,
65
  "repeat_penalty": 1.1,
66
+ "num_predict": 500,
67
  "stop": ["<SUF>", "<PRE>", "</PRE>", "</SUF>", "< EOT >", "\\end", "<MID>", "</MID>", "##"]
68
  }'
69
  ```
70
 
71
+ In general, the prompt format for CodeLlama-13B-QML is:
72
  ```
73
  "<SUF>{suffix}<PRE>{prefix}<MID>"
74
  ```
 
78
  "<PRE>{prefix}<MID>"
79
  ```
80
 
81
+ ## Modify and Adapt CodeLlama-13B-QML:
82
+
83
+ The HuggingFace repository contains all necessary components including the .safetensors files and tokenizer configurations, giving you everything needed to modify the model across various environments and better suit your specific requirements or train it on your custom dataset.
84
 
85
  ## Model Version:
86
  v2.0