Correct whitespace/nl editor config

This commit is contained in:
pudepiedj 2024-03-04 08:02:28 +00:00
parent 4089657815
commit f2f002d9af
2 changed files with 10 additions and 10 deletions

View file

@ -62,13 +62,13 @@ def send_request(q, question, event, count, num_requests):
delay = 0.1 delay = 0.1
global bar global bar
system = "You are a helpful assistant who answers all requests \ system = "You are a helpful assistant who answers all requests \
courteously and accurately without undue repetion. \ courteously and accurately without undue repetion. \
You pay close attention to the nuance of a question and respond accordingly." You pay close attention to the nuance of a question and respond accordingly."
data = {'system': system, 'prompt': question} data = {'system': system, 'prompt': question}
try: try:
response = requests.post(url, headers=headers, json=data) response = requests.post(url, headers=headers, json=data)
if response.status_code in [200,300]: if response.status_code in [200,300]:
@ -109,7 +109,7 @@ if __name__ == "__main__":
global bar global bar
lockbar = threading.Lock() lockbar = threading.Lock()
url = "http://192.168.1.28:8080/completion" url = "http://192.168.1.28:8080/completion"
num_requests = 76 num_requests = 76
@ -123,7 +123,7 @@ if __name__ == "__main__":
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'Llamaserver.py', 'User-Agent': 'Llamaserver.py',
'Authorization': f'Bearer {api_key}' 'Authorization': f'Bearer {api_key}'
} }
@ -135,7 +135,7 @@ if __name__ == "__main__":
"Erasmus", "Thomas More", "Luther", "Calvin", "Thomas Cranmer", "Shakespeare", "Erasmus", "Thomas More", "Luther", "Calvin", "Thomas Cranmer", "Shakespeare",
"Francis Bacon", "Thomas Cromwell", "Thomas Hobbes", "John Locke", "David Hume", "Berkeley", "Immanuel Kant", "Francis Bacon", "Thomas Cromwell", "Thomas Hobbes", "John Locke", "David Hume", "Berkeley", "Immanuel Kant",
"Jeremy Bentham", "William Blake", "John Stuart Mill", "Peirce", "Ralph Waldo Emerson", "Emily Dickinson", "Walt Whitman", "William James", "Henry James", "Henry Sidgwick", "John Dewey"] "Jeremy Bentham", "William Blake", "John Stuart Mill", "Peirce", "Ralph Waldo Emerson", "Emily Dickinson", "Walt Whitman", "William James", "Henry James", "Henry Sidgwick", "John Dewey"]
country_list = ["France", "Germany", "China", "USA", "Italy", "India", country_list = ["France", "Germany", "China", "USA", "Italy", "India",
"Ukraine", "Japan", "Australia", "New Zealand", "Indonesia", "Nigeria", "Saudi Arabia", "Ukraine", "Japan", "Australia", "New Zealand", "Indonesia", "Nigeria", "Saudi Arabia",
"Israel", "Egypt", "Kenya", "Chile", "Mexico", "Canada", "Ecuador", "Brazil", "Argentina", "Colombia", "Israel", "Egypt", "Kenya", "Chile", "Mexico", "Canada", "Ecuador", "Brazil", "Argentina", "Colombia",
@ -147,14 +147,14 @@ if __name__ == "__main__":
"Melanie Klein", "John Puddefoot"] "Melanie Klein", "John Puddefoot"]
num_requests = len(philosopher_list) num_requests = len(philosopher_list)
for i in range(num_requests): for i in range(num_requests):
writer = philosopher_list[i % num_requests] writer = philosopher_list[i % num_requests]
question = f"Tell me about the writings of {writer}." question = f"Tell me about the writings of {writer}."
# NOTE: don't pass the parameter as a function call; pass in args # NOTE: don't pass the parameter as a function call; pass in args
print(f"Processing request {i} / {num_requests}: {question}\n") print(f"Processing request {i} / {num_requests}: {question}\n")
event = threading.Event() event = threading.Event()
t = threading.Thread(target=send_request, args=(q, question, event, i, num_requests)) t = threading.Thread(target=send_request, args=(q, question, event, i, num_requests))
t.start() t.start()
threads.append(t) threads.append(t)
@ -164,6 +164,6 @@ if __name__ == "__main__":
''' '''
print("FINISHED AND GETTING RESULTS") print("FINISHED AND GETTING RESULTS")
while not q.empty(): while not q.empty():
text = q.get() text = q.get()
print_dict(json.loads(text)) print_dict(json.loads(text))
''' '''

View file

@ -5,6 +5,6 @@
"fred": ["fred123123","fred0001"], "fred": ["fred123123","fred0001"],
"george":["george890890","george0001"], "george":["george890890","george0001"],
"sandra":["sandra234234","sandra0001"], "sandra":["sandra234234","sandra0001"],
"tilly":["tilly567567","tilly0001"], "tilly":["tilly567567","tilly0001"],
"owner":["sk-notarealapikey","owner0001"] "owner":["sk-notarealapikey","owner0001"]
} }