Views
No views yet

A chat.
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-4bit-64g-actorder_True | 4 | 64 | Yes | 0.1 | wikitext | 4096 | 18.98 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower 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/Airoboros-c34B-2.1-GPTQ:maingit clone --single-branch --branch main https://huggingface.co/TheBloke/Airoboros-c34B-2.1-GPTQrevision parameter; see below.TheBloke/Airoboros-c34B-2.1-GPTQ.TheBloke/Airoboros-c34B-2.1-GPTQ:mainAiroboros-c34B-2.1-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/Airoboros-c34B-2.1-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'''A chat.
15USER: {prompt}
16ASSISTANT:
17
18'''
19
20print("\n\n*** Generate:")
21
22input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
23output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
24print(tokenizer.decode(output[0]))
25
26# Inference can also be done using transformers' pipeline
27
28print("*** Pipeline:")
29pipe = pipeline(
30 "text-generation",
31 model=model,
32 tokenizer=tokenizer,
33 max_new_tokens=512,
34 do_sample=True,
35 temperature=0.7,
36 top_p=0.95,
37 top_k=40,
38 repetition_penalty=1.1
39)
40
41print(pipe(prompt_template)[0]['generated_text'])cull-instructions entrypoint in airoboros to shrink the m2.0 dataset to a smaller subset of high-quality instructions (according to gpt-4)A chat. USER: {prompt} ASSISTANT: A chat.
USER: {prompt}
ASSISTANT:BEGININPUT
BEGINCONTEXT
[key0: value0]
[key1: value1]
... other metdata ...
ENDCONTEXT
[insert your text blocks here]
ENDINPUT
[add as many other blocks, in the exact same format]
BEGININSTRUCTION
[insert your instruction(s). The model was tuned with single questions, paragraph format, lists, etc.]
ENDINSTRUCTIONBEGININPUT - denotes a new input blockBEGINCONTEXT - denotes the block of context (metadata key/value pairs) to associate with the current input blockENDCONTEXT - denotes the end of the metadata block for the current inputENDINPUT - denotes the end of the current input blockBEGININSTRUCTION - denotes the start of the list (or one) instruction(s) to respond to for all of the input blocks above.ENDINSTRUCTION - denotes the end of instruction setENDINSTRUCTION, but by explicitly including that in the prompt, the model better understands that all of the instructions in the block should be responded to.BEGININPUT
BEGINCONTEXT
date: 2021-01-01
url: https://web.site/123
ENDCONTEXT
In a shocking turn of events, blueberries are now green, but will be sticking with the same name.
ENDINPUT
BEGININSTRUCTION
What color are bluberries? Source?
ENDINSTRUCTIONBlueberries are now green.
Source:
date: 2021-01-01
url: https://web.site/123Create a python application with the following requirements:
- Asyncio FastAPI webserver
- ping endpoint that returns the current date in JSON format
- file upload endpoint, which calculates the file's sha256 checksum, and checks postgres to deduplicateWrite a multi-threaded TCP server in C that accepts a "GET [key]" input and "SET [key] [value]" input, and uses a binary tree to get and store the input values.Write a websocket application in node.js. PLAINFORMATAs an AI assistant, please select the most suitable function and parameters from the list of available functions below, based on the user's input. Provide your response in JSON format.
Input: I want to know how many times 'Python' is mentioned in my text file.
Available functions:
file_analytics:
description: This tool performs various operations on a text file.
params:
action: The operation we want to perform on the data, such as "count_occurrences", "find_line", etc.
filters:
keyword: The word or phrase we want to search for.1{
2 "function": "file_analytics",
3 "params": {
4 "action": "count_occurrences",
5 "filters": {
6 "keyword": "Python"
7 }
8 }
9}A group of people decide to play a round-robin tournament where every player plays every other player exactly once. If a total of 45 games were played, how many players participated in the tournament? Offer several potential answers, rank them according to mathematical logic, and pick the most feasible one.Solution 1:
In a round-robin tournament, each player plays every other player exactly once. This means that the total number of games played is equal to the combination of all players taken two at a time (since a game involves two players).
The formula for combinations is nC2 = n(n-1)/2, where n is the total number of players. We know that nC2 equals 45 (the total number of games), so we can set up the equation as follows:
n(n-1)/2 = 45
Solving this equation gives us n=10.
Final answer: There were 10 players in the tournament.
Solution 2:
Another way to approach this problem is by using the concept of triangular numbers. Triangular numbers are a sequence of numbers where each number can be represented as a triangle with dots. The nth triangular number is given by the sum of the first n natural numbers.
If we consider each game as a dot and each player as a side of the triangle, then the total number of games (45) would correspond to the 9th triangular number because 1+2+3+4+5+6+7+8+9=45. However, since each side of the triangle represents a player, and there's one more player than sides in our model (because the last player has no one left to play against), we need to add one more to get the total number of players.
Final answer: There were 10 players in the tournament.
Solution 3:
We could also use trial and error to solve this problem. Starting from a small number of players, we calculate how many games would be played in a round-robin tournament until we reach 45 games. For example, with 2 players, only 1 game is played; with 3 players, 3 games are played; with 4 players, 6 games are played, and so on. Continuing this process, we find that with 10 players, 45 games are played.
Final answer: There were 10 players in the tournament.
Ranking of solutions from best to worst:
1. Solution 1: This solution uses direct mathematical reasoning based on the properties of a round-robin tournament and solves an equation to find the answer.
2. Solution 2: This solution uses the concept of triangular numbers which requires additional steps and knowledge beyond the immediate problem context, but still arrives at the correct answer.
3. Solution 3: This solution relies on trial and error, which is less efficient and reliable than the other methods, but it eventually gets to the right answer.
Best and final answer: There were 10 players in the tournament.Please construct a systematic plan to generate an optimal response to the user instruction, utilizing a set of provided tools. Each plan will correspond to an evidence value, which will be the output of one of the available functions given an input string
that could be the user's question, one or more prior evidence values, or a combination of both.
Here are the tools available to be called:
DuckDuckGo[input]: Tool that enables the user to search for information using the DuckDuckGo search engine. This tool is helpful in locating a suitable list of sites that may contain the answer to the user's query. It does not directly answer the question but finds a list of sites that might have the answer.
TextScraper[input]: Load one or more websites from the input string containing newline delimited links, where input is one or more links, and produces plain text output containing the content of the links.
HyperlinkExtractor[input]: Extract links from plain text and produces a plain text, newline delimited response of links.
KnowledgeModel[input]: Question answering language model, particularly useful in answering questions based on an input passage of text. The input must be a text question that references an :evidence[n]: variable, e.g. What color is the cat, given :evidence1:?
The output should be in format:
Plan: [first action to take based on input question]
:evidence0: = [function to call with input parameter]
Plan: [next action to take, based on result of :evidence0:]
:evidence1: = [next function to call and input parameter, which may include reference to previous evidence, e.g. "Given context :evidence0"]
...
Answer: [:evidence[n]: containing the final answer.]
Question: Who won the Nobel Prize in Literature in 2020 and what is their most famous work?Plan: Begin by conducting a web search to find out who won the Nobel Prize in Literature in 2020.
:evidence0: = DuckDuckGo[Nobel Prize in Literature 2020 winner]
Plan: Utilize the KnowledgeModel to interpret the search results and find the name of the laureate.
:evidence1: = KnowledgeModel[Who won the Nobel Prize in Literature in 2020, given :evidence0:?]
Plan: Conduct another web search to find the most famous work of the identified laureate.
:evidence2: = DuckDuckGo[Most famous work of :evidence1:]
Plan: Extract the relevant links from the DuckDuckGo search results for a more focused search.
:evidence3: = HyperlinkExtractor[:evidence2:]
Plan: Use the TextScraper tool to extract information from the relevant links.
:evidence4: = TextScraper[:evidence3:]
Plan: Finally, utilize the KnowledgeModel to identify and summarize the most famous work of the laureate from the extracted information.
:evidence5: = KnowledgeModel[What is the most famous work of :evidence1:, given :evidence4:?]
Answer: :evidence5:1import re
2import requests
3
4def inject_context(input_text, **context):
5 for ref in set(re.findall(r"(:evidence[0-9]+:)", input_text, re.I)):
6 input_text = input_text.replace(ref, context.get(ref, ""))
7 return input_text
8
9def duckduckgo(input_text, **context):
10 search_string = inject_context(input_text, **context)
11 ... search via duck duck go using search_string
12 ... return text content
13
14def link_extractor(input_text, **context):
15 input_text = inject_context(input_text, **context)
16 return "\n".join(list(set(re.findall(r"(https?://[^\s]+?\.?)", input_text, re.I))))
17
18def scrape(input_text, **context):
19 input_text = inject_context(input_text, **context)
20 text = []
21 for link in input_text.splitlines():
22 text.append(requests.get(link).text)
23 return "\n".join(text)
24
25def infer(input_text, **context)
26 prompt = inject_context(input_text, **context)
27 ... call model with prompt, return output
28
29def parse_plan(plan):
30 method_map = {
31 "DuckDuckGo": duckduckgo,
32 "HyperlinkExtractor": link_extractor,
33 "KnowledgeModel": infer,
34 "TextScraper": scrape,
35 }
36 context = {}
37 for line in plan.strip().splitlines():
38 if line.startswith("Plan:"):
39 print(line)
40 continue
41 parts = re.match("^(:evidence[0-9]+:)\s*=\s*([^\[]+])(\[.*\])\s$", line, re.I)
42 if not parts:
43 if line.startswith("Answer: "):
44 return context.get(line.split(" ")[-1].strip(), "Answer couldn't be generated...")
45 raise RuntimeError("bad format: " + line)
46 context[parts.group(1)] = method_map[parts.group(2)](parts.group(3), **context)