Views
No views yet

Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{prompt}
### Response:
cc-by-nc-4.0, and this quantization has therefore used that same license.TheBloke/UtopiaXL-13B-AWQ.UtopiaXL-13B-AWQ--quantization awq parameter.python3 python -m vllm.entrypoints.api_server --model TheBloke/UtopiaXL-13B-AWQ --quantization awqquantization=awq.1from vllm import LLM, SamplingParams
2
3prompts = [
4 "Tell me about AI",
5 "Write a story about llamas",
6 "What is 291 - 150?",
7 "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
8]
9prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
10
11### Instruction:
12{prompt}
13
14### Response:
15'''
16
17prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
18
19sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
20
21llm = LLM(model="TheBloke/UtopiaXL-13B-AWQ", quantization="awq", dtype="auto")
22
23outputs = llm.generate(prompts, sampling_params)
24
25# Print the outputs.
26for output in outputs:
27 prompt = output.prompt
28 generated_text = output.outputs[0].text
29 print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")ghcr.io/huggingface/text-generation-inference:1.1.0--model-id TheBloke/UtopiaXL-13B-AWQ --port 3000 --quantize awq --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'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
7
8### Instruction:
9{prompt}
10
11### Response:
12'''
13
14client = InferenceClient(endpoint_url)
15response = client.text_generation(prompt,
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
23print(f"Model output: ", response)pip3 install autoawq1pip3 uninstall -y autoawq
2git clone https://github.com/casper-hansen/AutoAWQ
3cd AutoAWQ
4pip3 install .1from awq import AutoAWQForCausalLM
2from transformers import AutoTokenizer
3
4model_name_or_path = "TheBloke/UtopiaXL-13B-AWQ"
5
6# Load tokenizer
7tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
8# Load model
9model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
10 trust_remote_code=False, safetensors=True)
11
12prompt = "Tell me about AI"
13prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
14
15### Instruction:
16{prompt}
17
18### Response:
19'''
20
21print("*** Running model.generate:")
22
23token_input = tokenizer(
24 prompt_template,
25 return_tensors='pt'
26).input_ids.cuda()
27
28# Generate output
29generation_output = model.generate(
30 token_input,
31 do_sample=True,
32 temperature=0.7,
33 top_p=0.95,
34 top_k=40,
35 max_new_tokens=512
36)
37
38# Get the tokens from the output, decode them, print them
39token_output = generation_output[0]
40text_output = tokenizer.decode(token_output)
41print("LLM output: ", text_output)
42
43"""
44# Inference should be possible with transformers pipeline as well in future
45# But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
46from transformers import pipeline
47
48print("*** Pipeline:")
49pipe = pipeline(
50 "text-generation",
51 model=model,
52 tokenizer=tokenizer,
53 max_new_tokens=512,
54 do_sample=True,
55 temperature=0.7,
56 top_p=0.95,
57 top_k=40,
58 repetition_penalty=1.1
59)
60
61print(pipe(prompt_template)[0]['generated_text'])
62"""Loader: AutoAWQ.!mergekit-layershuffle ./UtopiaXL \
--model Undi95/Utopia-13B --weight 0.4 \
--model KoboldAI/LLAMA2-13B-Holodeck-1 --weight 0.1 \
--model Undi95/PsyMedRP-v1-13B --weight 0.1 \
--model PygmalionAI/pygmalion-2-13b --weight 0.25 \
--model Heralax/Cat-0.5 --weight 0.1 \
--model KoboldAI/LLaMA2-13B-TiefighterLR --weight 0.1 \
--model Heralax/Augmental-13b-two-epochs --weight 0.1 \
--write-yaml UtopiaXL.yaml
=========================
merge_method: passthrough
slices:
- sources:
- layer_range:
- 0
- 1
model: KoboldAI/LLAMA2-13B-Holodeck-1
- sources:
- layer_range:
- 1
- 4
model: Undi95/Utopia-13B
- sources:
- layer_range:
- 4
- 5
model: PygmalionAI/pygmalion-2-13b
- sources:
- layer_range:
- 5
- 6
model: Undi95/PsyMedRP-v1-13B
- sources:
- layer_range:
- 6
- 7
model: KoboldAI/LLaMA2-13B-TiefighterLR
- sources:
- layer_range:
- 7
- 8
model: PygmalionAI/pygmalion-2-13b
- sources:
- layer_range:
- 8
- 9
model: Undi95/PsyMedRP-v1-13B
- sources:
- layer_range:
- 9
- 10
model: PygmalionAI/pygmalion-2-13b
- sources:
- layer_range:
- 10
- 13
model: Undi95/Utopia-13B
- sources:
- layer_range:
- 13
- 14
model: Heralax/Cat-0.5
- sources:
- layer_range:
- 14
- 17
model: Undi95/Utopia-13B
- sources:
- layer_range:
- 17
- 18
model: Heralax/Augmental-13b-two-epochs
- sources:
- layer_range:
- 18
- 19
model: KoboldAI/LLaMA2-13B-TiefighterLR
- sources:
- layer_range:
- 19
- 22
model: PygmalionAI/pygmalion-2-13b
- sources:
- layer_range:
- 22
- 23
model: Undi95/Utopia-13B
- sources:
- layer_range:
- 23
- 25
model: PygmalionAI/pygmalion-2-13b
- sources:
- layer_range:
- 25
- 27
model: Undi95/Utopia-13B
- sources:
- layer_range:
- 27
- 28
model: Heralax/Cat-0.5
- sources:
- layer_range:
- 28
- 30
model: Undi95/Utopia-13B
- sources:
- layer_range:
- 30
- 31
model: Heralax/Augmental-13b-two-epochs
- sources:
- layer_range:
- 31
- 32
model: Undi95/Utopia-13B
- sources:
- layer_range:
- 32
- 33
model: Heralax/Cat-0.5
- sources:
- layer_range:
- 33
- 34
model: Heralax/Augmental-13b-two-epochs
- sources:
- layer_range:
- 34
- 35
model: Undi95/PsyMedRP-v1-13B
- sources:
- layer_range:
- 35
- 36
model: Heralax/Augmental-13b-two-epochs
- sources:
- layer_range:
- 36
- 37
model: Undi95/Utopia-13B
- sources:
- layer_range:
- 37
- 38
model: KoboldAI/LLAMA2-13B-Holodeck-1
- sources:
- layer_range:
- 38
- 39
model: PygmalionAI/pygmalion-2-13b
- sources:
- layer_range:
- 39
- 40
model: KoboldAI/LLAMA2-13B-Holodeck-1
=========================
=> Applying Undi95/Storytelling-v2.1-13B-lora x 0.1
=> Trained on LimaRP for +2h
=> Applying Undi95/LimaRP-UtopiaXL-13B-v3-lora x 0.35Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{prompt}
### Response: