From 9327ac80df9a537bc9e14dc9ed2c0b36762e09cc Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Tue, 11 Feb 2025 19:55:32 +0100 Subject: [PATCH 1/5] added usage example --- example.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 example.py diff --git a/example.py b/example.py new file mode 100644 index 0000000..ae3a35a --- /dev/null +++ b/example.py @@ -0,0 +1,15 @@ +from transformers import AutoModelForCausalLM, AutoTokenizer + + +location = "Godala-moe" + +device = "cuda" # cpu when not using gpu +tokenizer = AutoTokenizer.from_pretrained(location) + +model = AutoModelForCausalLM.from_pretrained(location).to(device) + +messages = [{"role": "user", "content": "What can you tell me about Godot?"}] +input_text=tokenizer.apply_chat_template(messages, tokenize=False) +inputs = tokenizer.encode(input_text, return_tensors="pt").to(device) +outputs = model.generate(inputs, max_new_tokens=510, temperature=0.2, top_p=0.9, do_sample=True) +print(tokenizer.decode(outputs[0])) From 3bcf8a25b2386ee62e328f55346cbd1431683c89 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Tue, 11 Feb 2025 21:00:37 +0100 Subject: [PATCH 2/5] updated to ignore model --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 5d381cc..e234c59 100644 --- a/.gitignore +++ b/.gitignore @@ -153,6 +153,10 @@ dmypy.json # Cython debug symbols cython_debug/ +#model +Godola +Godola-moe + # PyCharm # JetBrains specific template is maintained in a separate JetBrains.gitignore that can # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore From 4cc7b619f9e514a3540c4379cd432bb13c719932 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Tue, 11 Feb 2025 21:00:46 +0100 Subject: [PATCH 3/5] simplified comments --- example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.py b/example.py index ae3a35a..44e336e 100644 --- a/example.py +++ b/example.py @@ -3,7 +3,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer location = "Godala-moe" -device = "cuda" # cpu when not using gpu +device = "gpu" # or cpu tokenizer = AutoTokenizer.from_pretrained(location) model = AutoModelForCausalLM.from_pretrained(location).to(device) From 02ce83a4c183db530cc1965c3489677ba1ad0208 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Tue, 11 Feb 2025 21:02:02 +0100 Subject: [PATCH 4/5] added readme documentation --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 69a94e3..7ca21a8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,58 @@ -# Godala +# Godala-moe: A Mixture of Experts LLM Model -Godala is a custom AI model based on SmollM2, designed specifically for single-turn conversations. It has undergone various steps of continued pretraining and fine-tuning to enhance its capabilities. Godala specializes in answering questions about the Godot Game Engine and providing guidance on coding with GDScript. \ No newline at end of file +## Overview + +Godala-moe is an edge-ready Large Language Model (LLM) designed to run efficiently on various platforms. It is based on the [Hugging Face HuggingFaceTB/SmolLM2-1.7B Base model](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B) and has undergone continued pretraining stages, multiple finetuning steps, and merging processes to create a mixture of experts. + +## Features + +- **Edge-Ready**: Designed to run on edge devices with minimal resource requirements. +- **Mixture of Experts**: Combines multiple expert models for enhanced performance. +- **Continued Pretraining**: Underwent continued pretraining stages to improve model quality. +- **Finetuning**: Multiple finetuning steps to specialize the model for specific tasks. + +## Current Status + +The model has currently been trained on approximately 400 million tokens. While it shows promise, the quality is not yet at its optimal level due to the limited training data. Additionally, the code generation feature does not currently produce output in Markdown format. + +## Future Improvements + +- **Increase Training Tokens**: Plan to increase the number of training tokens to improve model performance. +- **Markdown Highlighting**: Implement correct markdown highlighting for better readability. +- **Increased Parameters**: Aim to increase the model parameters for enhanced capabilities. + +## Usage + +To use Godala-moe, follow these steps: + +1. **Install Dependencies**: + Ensure you have the necessary dependencies installed. You can install them using pip: + ```bash + pip install transformers torch + ``` + +2. **Run the Model**: + Use the provided script to run the model. Here is an example script: + ```python + from transformers import AutoModelForCausalLM, AutoTokenizer + + location = "Godala-moe" + device = "cuda" # Use "cpu" when not using GPU + tokenizer = AutoTokenizer.from_pretrained(location) + model = AutoModelForCausalLM.from_pretrained(location).to(device) + + messages = [{"role": "user", "content": "What can you tell me about Godot?"}] + input_text = tokenizer.apply_chat_template(messages, tokenize=False) + inputs = tokenizer.encode(input_text, return_tensors="pt").to(device) + outputs = model.generate(inputs, max_new_tokens=510, temperature=0.2, top_p=0.9, do_sample=True) + print(tokenizer.decode(outputs[0])) + ``` + +## Download + +You can download the Godala-moe model from [this Link](https://gitea.fabelous.app/Maschine-Learning/Godola/releases/download/latest/Godola-moe.zip). + + +## License + +This project is licensed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). The original model was licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). From fb4438b9076041bb9398ce3aa7e2f8384768b0ff Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Tue, 11 Feb 2025 21:02:17 +0100 Subject: [PATCH 5/5] added python requirements --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..747b7aa --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +transformers \ No newline at end of file