Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
fengsxy committed May 5, 2024
1 parent a1f4e47 commit 5a30396
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
15 changes: 0 additions & 15 deletions gpt_batch/batcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def process_attitude(self, message_list):

executor = ThreadPoolExecutor(max_workers=num_workers)
message_chunks = list(self.chunk_list(message_list, num_workers))
<<<<<<< HEAD
try:
for chunk in tqdm(message_chunks, desc="Processing messages"):
future_to_message = {executor.submit(self.get_attitude, message): message for message in chunk}
Expand All @@ -78,20 +77,6 @@ def process_attitude(self, message_list):
finally:
executor.shutdown(wait=False)
return new_list
=======
for chunk in tqdm(message_chunks, desc="Processing messages"):
future_to_message = {executor.submit(self.get_attitude, message): message for message in chunk}
for _ in range(retry_attempts):
done, not_done = wait(future_to_message.keys(), timeout=timeout_duration)
for future in not_done:
future.cancel()
new_list.extend(future.result() for future in done if future.done())
if len(not_done) == 0:
break
future_to_message = {executor.submit(self.get_attitude, future_to_message[future]): future_to_message[future] for future in not_done}
executor.shutdown(wait=False)
return new_list
>>>>>>> 15a870c57eb93e1942068418d5d41079d054e8b7

def complete_attitude_list(self,attitude_list, max_length):
completed_list = []
Expand Down
4 changes: 0 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

setup(
name='gpt_batch',
<<<<<<< HEAD
version='0.1.5',
=======
version='0.1.3',
>>>>>>> 15a870c57eb93e1942068418d5d41079d054e8b7
packages=find_packages(),
install_requires=[
'openai', 'tqdm'
Expand Down

0 comments on commit 5a30396

Please sign in to comment.