HachiML / SkillTree-Code-llama2-7b-hf

huggingface.co
Total runs: 13
24-hour runs: 0
7-day runs: 0
30-day runs: 2
Model's Last Updated: April 05 2024
text-generation

Introduction of SkillTree-Code-llama2-7b-hf

Model Details of SkillTree-Code-llama2-7b-hf

SkillTree Model Collection

Applying a skill to your model with SkillTree is akin to unlocking a new ability in a video game's skill tree. Just as you would enhance your character's capabilities by selecting and activating specific skills, you can augment your model's abilities by integrating specialized skills. Follow these steps to imbue your model with new prowess, enhancing its performance and versatility in a straightforward and intuitive manner.
Please note that SkillTree abilities may not function in all cases. To determine whether a specific skill is operational, refer to the Functionality Status.

What is SkillTree?

SkillTree represents a set of model weights derived from further pre-training or fine-tuning Large Language Models (LLMs) to extract specific capabilities, such as code generation or chatting abilities. These extracted "skills" can be combined with a specific LLM base model to enhance its capabilities. The concept is inspired by ChatVector , aiming to modularize and transfer distinct skills across models.

SkillTree Details
Uses
Limitation
  • Model Architecture: Llama2
  • Model Size: 6.74B
  • Compatible Models[optional]:
How to Apply Skill (Example)
# Import Library
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

# Load the target model to be applied skill
tokenizer = AutoTokenizer.from_pretrained(
    "tokyotech-llm/Swallow-7b-hf"
)
model = AutoModelForCausalLM.from_pretrained(
    "tokyotech-llm/Swallow-7b-hf",
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

# Load SkillTree
skill_tree = AutoModelForCausalLM.from_pretrained(
    "HachiML/SkillTree-llama2-7b-hf-Code",
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

# Apply the skill to the target model
def apply_skill(model, skill_tree):
    # excluded object
    skip_layers = ["model.embed_tokens.weight", "model.norm.weight", "lm_head.weight"]
    # apply skill
    for k, v in model.state_dict().items():
        # layernorm is also excluded
        if (k in skip_layers) or ("layernorm" in k):
            continue
        vector = skill_tree.state_dict()[k]
        new_v = v + vector.to(v.device)
        v.copy_(new_v)
    return model

model = apply_skill(model, skill_tree)

# Push to hub
model_name = "HachiML/Swallow-7b-hf-CodeSkill"
tokenizer.save_pretrained(f"./models/{model_name}", repo_id=model_name, push_to_hub=True)
model.save_pretrained(f"./models/{model_name}", repo_id=model_name, push_to_hub=True)

Runs of HachiML SkillTree-Code-llama2-7b-hf on huggingface.co

13
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
2
30-day runs

More Information About SkillTree-Code-llama2-7b-hf huggingface.co Model

More SkillTree-Code-llama2-7b-hf license Visit here:

https://choosealicense.com/licenses/llama2

SkillTree-Code-llama2-7b-hf huggingface.co

SkillTree-Code-llama2-7b-hf huggingface.co is an AI model on huggingface.co that provides SkillTree-Code-llama2-7b-hf's model effect (), which can be used instantly with this HachiML SkillTree-Code-llama2-7b-hf model. huggingface.co supports a free trial of the SkillTree-Code-llama2-7b-hf model, and also provides paid use of the SkillTree-Code-llama2-7b-hf. Support call SkillTree-Code-llama2-7b-hf model through api, including Node.js, Python, http.

SkillTree-Code-llama2-7b-hf huggingface.co Url

https://huggingface.co/HachiML/SkillTree-Code-llama2-7b-hf

HachiML SkillTree-Code-llama2-7b-hf online free

SkillTree-Code-llama2-7b-hf huggingface.co is an online trial and call api platform, which integrates SkillTree-Code-llama2-7b-hf's modeling effects, including api services, and provides a free online trial of SkillTree-Code-llama2-7b-hf, you can try SkillTree-Code-llama2-7b-hf online for free by clicking the link below.

HachiML SkillTree-Code-llama2-7b-hf online free url in huggingface.co:

https://huggingface.co/HachiML/SkillTree-Code-llama2-7b-hf

SkillTree-Code-llama2-7b-hf install

SkillTree-Code-llama2-7b-hf is an open source model from GitHub that offers a free installation service, and any user can find SkillTree-Code-llama2-7b-hf on GitHub to install. At the same time, huggingface.co provides the effect of SkillTree-Code-llama2-7b-hf install, users can directly use SkillTree-Code-llama2-7b-hf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

SkillTree-Code-llama2-7b-hf install url in huggingface.co:

https://huggingface.co/HachiML/SkillTree-Code-llama2-7b-hf

Url of SkillTree-Code-llama2-7b-hf

SkillTree-Code-llama2-7b-hf huggingface.co Url

Provider of SkillTree-Code-llama2-7b-hf huggingface.co

HachiML
ORGANIZATIONS

Other API from HachiML