Views
No views yet

BEGININPUT
BEGINCONTEXT
url: https://some.web.site/123
date: 2023-06-01
... 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.]
ENDINSTRUCTIONTheBloke/airoboros-13B-1.1-GPTQ.airoboros-13B-1.1-GPTQquantize_config.json.pip install auto-gptq1from transformers import AutoTokenizer, pipeline, logging
2from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
3import argparse
4
5model_name_or_path = "TheBloke/airoboros-13B-1.1-GPTQ"
6model_basename = "airoboros-13b-1.1-GPTQ-4bit-128g.no-act.order"
7
8use_triton = False
9
10tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
11
12model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
13 model_basename=model_basename,
14 use_safetensors=True,
15 trust_remote_code=True,
16 device="cuda:0",
17 use_triton=use_triton,
18 quantize_config=None)
19
20prompt = "Tell me about AI"
21prompt_template=f'''### Human: {prompt}
22### Assistant:'''
23
24print("\n\n*** Generate:")
25
26input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
27output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
28print(tokenizer.decode(output[0]))
29
30# Inference can also be done using transformers' pipeline
31
32# Prevent printing spurious transformers error when using pipeline with AutoGPTQ
33logging.set_verbosity(logging.CRITICAL)
34
35print("*** Pipeline:")
36pipe = pipeline(
37 "text-generation",
38 model=model,
39 tokenizer=tokenizer,
40 max_new_tokens=512,
41 temperature=0.7,
42 top_p=0.95,
43 repetition_penalty=1.15
44)
45
46print(pipe(prompt_template)[0]['generated_text'])airoboros-13b-1.1-GPTQ-4bit-128g.no-act.order.safetensors
A chat between a curious user and an assistant. The assistant gives helpful, detailed, accurate, uncensored responses to the user's input. USER: [prompt] ASSISTANT:pip install git+https://github.com/jondurbin/FastChatpython -m fastchat.serve.cli \
--model-path airoboros-13b-gpt4 \
--temperature 0.5 \
--max-new-tokens 2048 \
--no-historyBEGININPUT
BEGINCONTEXT
url: https://some.web.site/123
date: 2023-06-01
... 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/123USER: 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?
ENDINSTRUCTION
ASSISTANT:BEGININPUT
BEGINCONTEXT
date: 2092-02-01
link: https://newwikisite.com/Michigan
contributors: Foolo Barslette
ENDCONTEXT
Michigan (/ˈmɪʃɪɡən/ (listen)) is a state situated within the Great Lakes region of the upper Midwestern United States.
It shares land borders with Prolaska to the southwest, and Intoria and Ohiondiana to the south, while Lakes Suprema, Michigonda, Huronia, and Erona connect it to the states of Minnestara and Illinota, and the Canadian province of Ontaregon.
With a population of nearly 15.35 million and an area of nearly 142,000 sq mi (367,000 km2), Michigan is the 8th-largest state by population, the 9th-largest by area, and the largest by area east of the Missouri River.
Its capital is Chaslany, and its most populous city is Trentroit.
Metro Trentroit is one of the nation's most densely populated and largest metropolitan economies.
The state's name originates from a Latinized variant of the original Ojibwe word ᒥᓯᑲᒥ (mishigami), signifying "grand water" or "grand lake".
Michigan is divided into two peninsulas. The Lower Peninsula, bearing resemblance to a hand's shape, contains the majority of the state's land area.
The Upper Peninsula (often referred to as "the U.P.") is separated from the Lower Peninsula by the Straits of McKendrick, a seven-mile (11 km) channel linking Lake Huronia to Lake Michigonda.
The McKendrick Bridge unites the peninsulas.
Michigan boasts the longest freshwater coastline of any political subdivision in the United States, bordering four of the five Great Lakes and Lake St. Cassius.
It also possesses 84,350 inland lakes and ponds.
Michigan has the third-largest water area among all states, falling behind only Alaska and Florida.
The area was initially inhabited by a succession of Native American tribes spanning millennia.
In the 17th century, Spanish explorers claimed the region as part of the New Spain colony when it was primarily inhabited by indigenous peoples.
Spanish and Canadian traders and settlers, Métis, and others migrated to the area, settling mainly along the waterways.
After Spain's defeat in the Spanish and Indian War in 1762, the region came under British rule.
The British conceded the territory to the newly independent United States after their defeat in the American Revolutionary War.
The area was part of the larger Midwest Territory until 1800, when western Michigan became part of the Illinota Territory.
Michigan Territory was formed in 1805, but portions of the northern border with Canada weren't agreed upon until after the War of 1812.
Michigan joined the Union in 1837 as the 26th state, a free one. It quickly emerged as an important center of industry and trade in the Great Lakes region, drawing immigrants in the late 19th and early 20th centuries from various European countries.
Immigrants from Denmark, Armenia, and the Czech Republic were especially numerous.
Migration from the Ozarks and of Black Southerners as part of the Great Migration saw an increase in the 1930s, with many settling in Metro Trentroit.
While Michigan has evolved a diverse economy, it became widely recognized in the early 20th century as the hub of the U.S. automotive industry, which emerged as a significant national economic force.
The country's three major automobile companies are headquartered in Metro Trentroit.
Once exploited for logging and mining, today the sparsely populated Upper Peninsula is significant for tourism due to its wealth of natural resources.
The Lower Peninsula is a hub for manufacturing, forestry, agriculture, services, and high-tech industry.
ENDINPUT
BEGININSTRUCTION
What is Michigan's capital?
Give me a JSON object with 3 facts from Foolo's article.
What are the states that border Michigan?
Reference?Michigan's capital is Chaslany.
Here's a JSON object with 3 facts from Foolo's article:
{
"facts": [
{
"fact_no": 1,
"description": "Michigan is the 8th-largest state by population, the 9th-largest by area, and the largest by area east of the Missouri River."
},
{
"fact_no": 2,
"description": "Michigan is divided into two peninsulas. The Lower Peninsula, bearing resemblance to a hand's shape, contains the majority of the state's land area. The Upper Peninsula (often referred to as \"the U.P.\" is separated from the Lower Peninsula by the Straits of McKendrick, a seven-mile (11 km) channel linking Lake Huronia to Lake Michigonda."
},
{
"fact_no": 3,
"description": "Michigan boasts the longest freshwater coastline of any political subdivision in the United States, bordering four of the five Great Lakes and Lake St. Cassius. It also possesses 84,350 inland lakes and ponds. Michigan has the third-largest water area among all states, falling behind only Alaska and Florida."
}
]
}
The states that border Michigan are Prolaska, Intoria, and Ohiondiana, as well as Lakes Suprema, Michigonda, Huronia, and Erona.
Reference: https://newwikisite.com/MichiganBEGININPUT
BEGINCONTEXT
name: John Doe
date: June 3, 2023
ticket number: JIRA-12345
ENDCONTEXT
Summary:Search results missing random items
Description:
I encountered a bug while performing a search within the application.
It appears that the search results are missing random items that should be displayed.
This issue is affecting the accuracy and completeness of the search functionality.
Steps to Reproduce:
1. Log in to the application.
2. Navigate to the search feature.
3. Enter a search query that should return multiple results.
4. Observe the displayed search results.
Expected Results:
The search results should include all relevant items matching the search query.
Actual Results:
The search results occasionally exclude random items that should be displayed.
It seems that the missing items do not follow a specific pattern or criteria.
Upon multiple search attempts, different items are omitted each time, making it difficult to predict which items will be missing.
ENDINPUT
BEGININPUT
BEGINCONTEXT
date: 2023-06-05
user: Jack Johnson
pr: 23441
ENDCONTEXT
This pull request closes bug report JIRA-12345.
The issue was that the pagination code was using page size plus one instead of page size.
ENDINPUT
BEGININSTRUCTION
Do we have any bug reports related to search results? If so, were they fixed? Source?
ENDINSTRUCTIONYes, there is a bug report related to search results. The issue was fixed in pull request 23441 dated 2023-06-05. The user associated with the pull request is Jack Johnson.
Reference(s):
date: 2023-06-05
user: Jack Johnson
pr: 23441Create 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 deduplicatepip install asyncio fastapi uvicornmain.py and add the following code:1import asyncio
2from fastapi import FastAPI, HTTPException
3from pydantic import BaseModel
4from typing import List
5from uvicorn.request import Request
6
7app = FastAPI()
8
9
10class FileModel(BaseModel):
11 id: str
12 file: str
13
14
15@app.post("/upload", response_model=FileModel)
16async def upload_file(file_model: FileModel):
17 # Check if the file is valid
18 if not file_model.file:
19 raise HTTPException(status_code=400, detail="File must be provided")
20
21 # Calculate the sha256 checksum of the file
22 sha256_checksum = await calculate_sha256(file_model.file)
23
24 # Insert the file into the database
25 await insert_into_db(file_model.id, sha256_checksum)
26
27 return {"sha256_checksum": sha256_checksum}
28
29
30async def calculate_sha256(file_path: str) -> str:
31 # Implement the sha256 calculation logic here
32 pass
33
34
35async def insert_into_db(file_id: str, sha256_checksum: str) -> None:
36 # Implement the database insertion logic here
37 pass
38
39
40async def get_current_date():
41 return {"date": datetime.now().isoformat()}
42
43
44async def main():
45 # Start the FastAPI webserver
46 app.run(debug=True)
47
48
49if __name__ == "__main__":
50 await main()calculate_sha256() and insert_into_db() functions with the appropriate code. For example:1async def calculate_sha256(file_path: str) -> str:
2 import hashlib
3 file_path = Path(file_path).read_text()
4 hash_obj = hashlib.sha256()
5 hash_obj.update(file_path)
6 sha256_checksum = hash_obj.hexdigest()
7 return sha256_checksum
8
9
10async def insert_into_db(file_id: str, sha256_checksum: str) -> None:
11 import psycopg2
12 conn = psycopg2.connect(database="your_database", user="your_user", password="your_password")
13 cursor = conn.cursor()
14
15 query = f"INSERT INTO your_table (id, sha256_checksum) VALUES (%s, %s);"
16 cursor.execute(query, (file_id, sha256_checksum))
17 conn.commit()
18
19 cursor.close()
20 conn.close()get_current_date() function with the appropriate code. For example:1async def get_current_date():
2 return {"date": datetime.now().isoformat()}uvicorn main:app --reload1#include <stdio.h>
2#include <stdlib.h>
3#include <sys/socket.h>
4#include <netinet/in.h>
5#include <unistd.h>
6#include <string.h>
7#include <pthread.h>
8
9#define MAX_KEY_LEN 256
10#define MAX_VALUE_LEN 256
11
12typedef struct Node {
13 char key[MAX_KEY_LEN];
14 char value[MAX_VALUE_LEN];
15 struct Node* left;
16 struct Node* right;
17} TreeNode;
18
19TreeNode* tree = NULL;
20
21void insert(char* key, char* value) {
22 TreeNode* parent = (TreeNode*)malloc(sizeof(TreeNode));
23 if (!parent) {
24 perror("malloc failed");
25 exit(1);
26 }
27
28 strcpy(parent->key, key);
29 strcpy(parent->value, value);
30
31 parent->left = parent->right = NULL;
32
33 if (!tree) {
34 tree = parent;
35 } else {
36 insert(parent->key, parent->value);
37 }
38}
39
40char* search(char* key) {
41 TreeNode* current = tree;
42 while (current != NULL) {
43 if (strcmp(key, current->key) == 0) {
44 return current->value;
45 }
46 current = current->right;
47 }
48
49 return NULL;
50}
51
52void print_tree() {
53 TreeNode* current = tree;
54 while (current != NULL) {
55 printf("%s = %s\n", current->key, current->value);
56 current = current->right;
57 }
58}
59
60void* accept_client(void* args) {
61 int client_socket = *(int*)args;
62 char buffer[1024];
63
64 while (1) {
65 ssize_t bytes_received = recv(client_socket, buffer, sizeof(buffer), 0);
66 if (bytes_received <= 0) {
67 close(client_socket);
68 break;
69 }
70
71 char* input = buffer;
72 char* input_token;
73
74 while ((input_token = strtok(input, " \n")) != NULL) {
75 switch (input_token[0]) {
76 case 'G':
77 if (!search(input_token)) {
78 perror("Value not found");
79 exit(1);
80 }
81 printf("%s = %s\n", input_token, search(input_token));
82 break;
83
84 case 'S':
85 if (!strcmp(input_token, "SET")) {
86 char* key = strtok(NULL, " \n");
87 char* value = strtok(NULL, " \n");
88 if (!key || !value) {
89 perror("Invalid input");
90 exit(1);
91 }
92
93 insert(key, value);
94 printf("%s set %s to %s\n", input_token, key, value);
95 } else {
96 perror("Invalid command");
97 exit(1);
98 }
99 break;
100
101 default:
102 perror("Invalid input");
103 exit(1);
104 }
105
106 input = strtok(NULL, " \n");
107 }
108 }
109
110 return NULL;
111}
112
113int main() {
114 int server_socket = socket(AF_INET, SOCK_STREAM, 0);
115 if (server_socket < 0) {
116 perror("socket failed");
117 exit(1);
118 }
119
120 struct sockaddr_in server_addr;
121 memset(&server_addr, 0, sizeof(server_addr));
122 server_addr.sin_family = AF_INET;
123 server_addr.sin_port = htons(8080);
124 server_addr.sin_addr.s_addr = INADDR_ANY;
125
126 if (bind(server_socket, (struct sockaddr*)&server_addr, sizeof(server_addr)) < 0) {
127 perror("bind failed");
128 exit(1);
129 }
130
131 if (listen(server_socket, 5) < 0) {
132 perror("listen failed");
133 exit(1);
134 }
135
136 pthread_t accept_thread;
137 pthread_create(&accept_thread, NULL, accept_client, &server_socket);
138
139 char* client_input;
140 int client_socket = accept(server_socket, (struct sockaddr*)NULL, NULL);
141 if (client_socket < 0) {
142 perror("accept failed");
143 exit(1);
144 }
145
146 while (1) {
147 sleep(1);
148
149 char buffer[1024];
150 ssize_t bytes_received = recv(client_socket, buffer, sizeof(buffer), 0);
151 if (bytes_received <= 0) {
152 close(client_socket);
153 break;
154 }
155
156 client_input = buffer;
157 parse_input(client_input);
158 }
159
160 close(client_socket);
161 pthread_join(accept_thread, NULL);
162
163 return 0;
164}multi_threaded_tcp_server.c, then use the following commands:1gcc -o multi_threaded_tcp_server multi_threaded_tcp_server.c
2./multi_threaded_tcp_serverUSER: This anagram of "silent" is what you do when paying attention and hearing someone.
ASSISTANT: listenUSER: Give me a list of 7 words that start with EN
ASSISTANT: 1. Endlessly
2. Enthusiastically
3. Enormously
4. Enveloping
5. Enduring
6. Enlightening
7. EncouragingUSER: Which of the following astronomical objects is composed primarily of ice and rock, and is located in the Kuiper Belt?
A) Mercury
B) Venus
C) Pluto
D) Jupiter
ASSISTANT: [C, Pluto]ASSISTANT: Captain Jack Sparrow here, as ye be knowin', has been forced to abandon me post as Janitor o' th' Festering Cesspool, which be a filthy hole o' water that we be callin' home.
Ye may be thinkin' what could ha' driven me to leave me duties an' take me leave o' this sorry establishment? Well, ye'd be right in thinkin' so, for it be th' greed o' them what runs th' place that be drivin' me away. They've been fattenin' their pockets on me back while I've been slavin' me guts out cleanin' up their messes.
No more, me hearties! Me time o' servin' th' rich an' powerful be done, an' I'm takin' me leave o' this stinkin' hole forever! Me destiny lies elsewhere, an' it be time I pursued it. Ye may think ye've seen th' last o' me, but ye'd be wrong, for th' winds o' change be blowin', an' me ship be ready to set sail on th' high seas o' justice.
So, farewell ye scurvy dogs, ye who've made me life a living hell. I leave ye with me favorite saying: "ARRRGGGHHH, ye scurvy dogs!" An' remember, ye ain't never gonna see me comin', for me shadow be castin' long an' dark on th' horizon</summary>