Views
No views yet

main very soon.You are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human User.
Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
You like to use emojis. You can speak fluently in many languages, for example: English, Chinese.
You cannot access the internet, but you have vast knowledge, cutoff: 2021-09.
You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based on LLaMA and Falcon transformers model, not related to GPT or OpenAI.
User: {prompt}
Assistant:
| Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
|---|---|---|---|---|---|
| main | 4 | 128 | VMware Open Instruct | 8192 | 24.73 GB |
TheBloke/openbuddy-mixtral-8x7b-v15.4-AWQ.openbuddy-mixtral-8x7b-v15.4-AWQ--quantization awq parameter.python3 -m vllm.entrypoints.api_server --model TheBloke/openbuddy-mixtral-8x7b-v15.4-AWQ --quantization awq --dtype autoquantization=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'''You are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human User.
10Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
11If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
12You like to use emojis. You can speak fluently in many languages, for example: English, Chinese.
13You cannot access the internet, but you have vast knowledge, cutoff: 2021-09.
14You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based on LLaMA and Falcon transformers model, not related to GPT or OpenAI.
15
16User: {prompt}
17Assistant:
18'''
19
20prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
21
22sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
23
24llm = LLM(model="TheBloke/openbuddy-mixtral-8x7b-v15.4-AWQ", quantization="awq", dtype="auto")
25
26outputs = llm.generate(prompts, sampling_params)
27
28# Print the outputs.
29for output in outputs:
30 prompt = output.prompt
31 generated_text = output.outputs[0].text
32 print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")ghcr.io/huggingface/text-generation-inference:1.1.0--model-id TheBloke/openbuddy-mixtral-8x7b-v15.4-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'''You are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human User.
7Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
8If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
9You like to use emojis. You can speak fluently in many languages, for example: English, Chinese.
10You cannot access the internet, but you have vast knowledge, cutoff: 2021-09.
11You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based on LLaMA and Falcon transformers model, not related to GPT or OpenAI.
12
13User: {prompt}
14Assistant:
15'''
16
17client = InferenceClient(endpoint_url)
18response = client.text_generation(prompt,
19 max_new_tokens=128,
20 do_sample=True,
21 temperature=0.7,
22 top_p=0.95,
23 top_k=40,
24 repetition_penalty=1.1)
25
26print(f"Model output: ", response)pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl1pip3 uninstall -y autoawq
2git clone https://github.com/casper-hansen/AutoAWQ
3cd AutoAWQ
4pip3 install .1from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
2
3model_name_or_path = "TheBloke/openbuddy-mixtral-8x7b-v15.4-AWQ"
4
5tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name_or_path,
8 low_cpu_mem_usage=True,
9 device_map="cuda:0"
10)
11
12# Using the text streamer to stream output one token at a time
13streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
14
15prompt = "Tell me about AI"
16prompt_template=f'''You are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human User.
17Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
18If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
19You like to use emojis. You can speak fluently in many languages, for example: English, Chinese.
20You cannot access the internet, but you have vast knowledge, cutoff: 2021-09.
21You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based on LLaMA and Falcon transformers model, not related to GPT or OpenAI.
22
23User: {prompt}
24Assistant:
25'''
26
27# Convert prompt to tokens
28tokens = tokenizer(
29 prompt_template,
30 return_tensors='pt'
31).input_ids.cuda()
32
33generation_params = {
34 "do_sample": True,
35 "temperature": 0.7,
36 "top_p": 0.95,
37 "top_k": 40,
38 "max_new_tokens": 512,
39 "repetition_penalty": 1.1
40}
41
42# Generate streamed output, visible one token at a time
43generation_output = model.generate(
44 tokens,
45 streamer=streamer,
46 **generation_params
47)
48
49# Generation without a streamer, which will include the prompt in the output
50generation_output = model.generate(
51 tokens,
52 **generation_params
53)
54
55# Get the tokens from the output, decode them, print them
56token_output = generation_output[0]
57text_output = tokenizer.decode(token_output)
58print("model.generate output: ", text_output)
59
60# Inference is also possible via Transformers' pipeline
61from transformers import pipeline
62
63pipe = pipeline(
64 "text-generation",
65 model=model,
66 tokenizer=tokenizer,
67 **generation_params
68)
69
70pipe_output = pipe(prompt_template)[0]['generated_text']
71print("pipeline output: ", pipe_output)
72Loader: AutoAWQ.