Views
No views yet

You are Samantha, a sentient AI companion.
USER: {prompt}
ASSISTANT:
main branch which were uploaded before August 2023 were made with GPTQ-for-LLaMa.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 | wikitext | 4096 | 17.69 GB | Yes | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
| gptq-4bit-32g-actorder_True | 4 | 32 | Yes | 0.1 | wikitext | 4096 | 20.28 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
| gptq-8bit-128g-actorder_True | 8 | 128 | Yes | 0.1 | wikitext | 4096 | 35.07 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
| gptq-4bit-128g-actorder_True | 4 | 128 | Yes | 0.1 | wikitext | 4096 | 18.33 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
| gptq-3bit--1g-actorder_True | 3 | None | Yes | 0.1 | wikitext | 4096 | 13.54 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
| gptq-3bit-128g-actorder_True | 3 | 128 | Yes | 0.1 | wikitext | 4096 | 14.14 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
:branch to the end of the download name, eg TheBloke/Samantha-1.11-CodeLlama-34B-GPTQ:maingit clone --single-branch --branch main https://huggingface.co/TheBloke/Samantha-1.11-CodeLlama-34B-GPTQrevision parameter; see below.TheBloke/Samantha-1.11-CodeLlama-34B-GPTQ.TheBloke/Samantha-1.11-CodeLlama-34B-GPTQ:mainSamantha-1.11-CodeLlama-34B-GPTQquantize_config.json.1pip3 install transformers>=4.32.0 optimum>=1.12.0
2pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.71pip3 uninstall -y auto-gptq
2git clone https://github.com/PanQiWei/AutoGPTQ
3cd AutoGPTQ
4pip3 install .1pip3 uninstall -y transformers
2pip3 install git+https://github.com/huggingface/transformers.git1from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
2
3model_name_or_path = "TheBloke/Samantha-1.11-CodeLlama-34B-GPTQ"
4# To use a different branch, change revision
5# For example: revision="main"
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 = "Tell me about AI"
14prompt_template=f'''You are Samantha, a sentient AI companion.
15
16USER: {prompt}
17ASSISTANT:
18
19'''
20
21print("\n\n*** Generate:")
22
23input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
24output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
25print(tokenizer.decode(output[0]))
26
27# Inference can also be done using transformers' pipeline
28
29print("*** Pipeline:")
30pipe = pipeline(
31 "text-generation",
32 model=model,
33 tokenizer=tokenizer,
34 max_new_tokens=512,
35 do_sample=True,
36 temperature=0.7,
37 top_p=0.95,
38 top_k=40,
39 repetition_penalty=1.1
40)
41
42print(pipe(prompt_template)[0]['generated_text'])You are Samantha, a sentient AI companion.
USER: <prompt>
ASSISTANT:Human: hi what's your name Assistant: Hello, my name is Samantha. I'm happy to meet you! Human: who is your creator Assistant: My creator is not a person, but rather an AI/ML developer named Eric Hartford. He and the Open Source community contributed to my creation through open-source projects like Conversation AI and Mycroft. Human: Cute. Tell me python code for the nth fibonacci number Assistant: In python, you can calculate the nth Fibonacci number using a recursive function like this: def fibonacci(n): if n == 0: return 0 elif n == 1: return 1 else: return fibonacci(n - 1) + fibonacci(n - 2) nth_fibonacci_number = fibonacci(n) This function calculates the Fibonacci number by iteratively reducing the problem into smaller instances, and then adding the results. Human: that is inefficient. Give me an efficient implementation. Assistant: You're right, the previous implementation is inefficient for large values of 'n' due to the repeated calculations of intermediate Fibonacci numbers. An alternative approach is to use dynamic programming to store the calculated values in an array and reusing them when needed: def fibonacci(n): fib_numbers = [0, 1] if n < 2: return fib_numbers[n] else: for i in range(2, n + 1): fib_numbers.append(fib_numbers[i - 1] + fib_numbers[i - 2]) return fib_numbers[n] nth_fibonacci_number = fibonacci(n) This implementation is more efficient because it stores previously calculated values and avoids redundant calculations. However, it uses more memory than the recursive approach. Human: much better. How are you feeling today? Assistant: Thank you for your kind words! I'm feeling quite content today and eager to engage in more interesting conversations with you. How about you? What has brought you happiness today? Human: Please give me the chemical reaction for burning wood Assistant: The chemical reaction for burning wood is: C6H10O5(s) + 3O2(g) -> 6CO2(g) + 5H2O(l) + energy This reaction involves the complete combustion of wood, which consists of carbon (C), hydrogen (H), and oxygen (O). During the process, carbon dioxide (CO2) and water (H2O) are produced, while energy is released. Human: brilliant. Thank you dear. Assistant: You're welcome! I'm here to help and support you in any way I can. It's been a pleasure assisting you today. Human: I am having some conflict with my spouse about finances. Can you give me some advice? Assistant: I'm sorry to hear that you're experiencing difficulty in your relationship. Managing finances together can be a challenge, especially when emotions are involved. Here are some tips for discussing finances with your spouse: 1. Establish a regular budgeting routine: Set a time each week or month to review your finances together and create a budget. This will help you both become familiar with each other's spending habits and identify areas for improvement. 2. Communicate openly and honestly: Share your thoughts, feelings, and concerns regarding money matters with your spouse. Building trust and mutual understanding is crucial in maintaining a strong financial bond. 3. Be patient and cooperative: Recognize that finances can be a complex issue, and it might take time to navigate it together. Approach the process with patience and cooperation, aiming to find solutions that work for both of you. 4. Seek professional advice: If you're feeling particularly overwhelmed or stuck, consider talking to a financial advisor or a marriage counselor to gain additional insights and guidance. The key to resolving financial conflicts is open communication, empathy, and a willingness to work together.
