Views
No views yet

### System:
### USER:{prompt}
### Assistant:
desc_act. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|---|---|---|---|---|---|---|---|---|---|
| main | 4 | None | Yes | 0.1 | VMware Open Instruct | 4096 | 18.50 GB | No | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
| gptq-4bit-128g-actorder_True | 4 | 128 | Yes | 0.1 | VMware Open Instruct | 4096 | 19.18 GB | No | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
| gptq-4bit-32g-actorder_True | 4 | 32 | Yes | 0.1 | VMware Open Instruct | 4096 | 21.28 GB | No | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
| gptq-3bit-128g-actorder_True | 3 | 128 | Yes | 0.1 | VMware Open Instruct | 4096 | 14.66 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
| gptq-8bit--1g-actorder_True | 8 | None | Yes | 0.1 | VMware Open Instruct | 4096 | 36.42 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
| gptq-3bit-32g-actorder_True | 3 | 32 | Yes | 0.1 | VMware Open Instruct | 4096 | 16.66 GB | No | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. |
| gptq-8bit-128g-actorder_True | 8 | 128 | Yes | 0.1 | VMware Open Instruct | 4096 | 37.24 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
main branch, enter TheBloke/Lumosia-MoE-4x10.7-GPTQ in the "Download model" box.:branchname to the end of the download name, eg TheBloke/Lumosia-MoE-4x10.7-GPTQ:gptq-4bit-128g-actorder_Truehuggingface-hub Python library:pip3 install huggingface-hubmain branch to a folder called Lumosia-MoE-4x10.7-GPTQ:1mkdir Lumosia-MoE-4x10.7-GPTQ
2huggingface-cli download TheBloke/Lumosia-MoE-4x10.7-GPTQ --local-dir Lumosia-MoE-4x10.7-GPTQ --local-dir-use-symlinks False--revision parameter:1mkdir Lumosia-MoE-4x10.7-GPTQ
2huggingface-cli download TheBloke/Lumosia-MoE-4x10.7-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir Lumosia-MoE-4x10.7-GPTQ --local-dir-use-symlinks False--local-dir-use-symlinks False parameter, the files will instead be stored in the central Hugging Face cache directory (default location on Linux is: ~/.cache/huggingface), and symlinks will be added to the specified --local-dir, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.HF_HOME environment variable, and/or the --cache-dir parameter to huggingface-cli.huggingface-cli, please see: HF -> Hub Python Library -> Download files -> Download from the CLI.hf_transfer:pip3 install hf_transferHF_HUB_ENABLE_HF_TRANSFER to 1:1mkdir Lumosia-MoE-4x10.7-GPTQ
2HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Lumosia-MoE-4x10.7-GPTQ --local-dir Lumosia-MoE-4x10.7-GPTQ --local-dir-use-symlinks Falseset HF_HUB_ENABLE_HF_TRANSFER=1 before the download command.git (not recommended)git, use a command like this:git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/Lumosia-MoE-4x10.7-GPTQhuggingface-hub, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the .git folder as a blob.)TheBloke/Lumosia-MoE-4x10.7-GPTQ.TheBloke/Lumosia-MoE-4x10.7-GPTQ:gptq-4bit-128g-actorder_TrueLumosia-MoE-4x10.7-GPTQquantize_config.json.ghcr.io/huggingface/text-generation-inference:1.1.0--model-id TheBloke/Lumosia-MoE-4x10.7-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096pip3 install huggingface-hub1from huggingface_hub import InferenceClient
2
3endpoint_url = "https://your-endpoint-url-here"
4
5prompt = "Tell me about AI"
6prompt_template=f'''### System:
7
8### USER:{prompt}
9
10### Assistant:
11'''
12
13client = InferenceClient(endpoint_url)
14response = client.text_generation(
15 prompt_template,
16 max_new_tokens=128,
17 do_sample=True,
18 temperature=0.7,
19 top_p=0.95,
20 top_k=40,
21 repetition_penalty=1.1
22)
23
24print(f"Model output: {response}")1pip3 install --upgrade transformers optimum
2# If using PyTorch 2.1 + CUDA 12.x:
3pip3 install --upgrade auto-gptq
4# or, if using PyTorch 2.1 + CUDA 11.x:
5pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/1pip3 uninstall -y auto-gptq
2git clone https://github.com/PanQiWei/AutoGPTQ
3cd AutoGPTQ
4git checkout v0.5.1
5pip3 install .1from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
2
3model_name_or_path = "TheBloke/Lumosia-MoE-4x10.7-GPTQ"
4# To use a different branch, change revision
5# For example: revision="gptq-4bit-128g-actorder_True"
6model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
7 device_map="auto",
8 trust_remote_code=False,
9 revision="main")
10
11tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
12
13prompt = "Write a story about llamas"
14system_message = "You are a story writing assistant"
15prompt_template=f'''### System:
16
17### USER:{prompt}
18
19### Assistant:
20'''
21
22print("\n\n*** Generate:")
23
24input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
25output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
26print(tokenizer.decode(output[0]))
27
28# Inference can also be done using transformers' pipeline
29
30print("*** Pipeline:")
31pipe = pipeline(
32 "text-generation",
33 model=model,
34 tokenizer=tokenizer,
35 max_new_tokens=512,
36 do_sample=True,
37 temperature=0.7,
38 top_p=0.95,
39 top_k=40,
40 repetition_penalty=1.1
41)
42
43print(pipe(prompt_template)[0]['generated_text'])
### System:
### USER:{prompt}
### Assistant:Temp: 1.0
min-p: 0.02-0.1Example 1:
User:
Hello lumi, what is the meaning of life
in around 100 words.
Lumosia:
The meaning of life can vary greatly
depending on individual beliefs,
values, and experiences. One common
perspective suggests that the primary
purpose of life is to seek happiness,
fulfillment, and personal growth
through relationships
accomplishments, and spiritual
awareness. Living with integrity.
compassion, and gratitude while
making a positive impact on others
and the world around us can also
contribute to finding meaning in life
UItimately, the meaning of life is
subjective and unique to each
individual, who must define it for
themselves through exploration
reflection, and personal choice.
Example 2:
User:
Explain a MoE (Mixture of Experts) in
around 100 words
Lumosia:
A MoE, short for Mixture of Experts, is
a machine learning technique utilized
in ensemble learning. It involves
combining multiple specialist models
(experts) to optimize predictive
performance. Each expert focuses on
a subset of the input features or data
domains, making them specialized in
particular areas. Through a weighting
mechanism, like Gaussian Mixture
Model, the predictions of experts are
blended to produce a final result. MoE
models demonstrate effectiveness in
handling complex or ambiguous
inputs where a single model might
struggle. They are commonly used in
natural language processing.
computer vision, and speech synthesis.yamlbase_model: DopeorNope/SOLARC-M-10.7B
gate_mode: hidden
dtype: bfloat16
experts:
- source_model: DopeorNope/SOLARC-M-10.7B
positive_prompts: [""]
- source_model: maywell/PiVoT-10.7B-Mistral-v0.2-RP
positive_prompts: [""]
- source_model: kyujinpy/Sakura-SOLAR-Instruct
positive_prompts: [""]
- source_model: jeonsworld/CarbonVillain-en-10.7B-v1
positive_prompts: [""]python
!pip install -qU transformers bitsandbytes accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "Steelskull/Lumosia-MoE-4x10.7"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
)
messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])