Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload proxy as a daemon #97

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,7 @@ that you should be abloe to create a pull request for the main repository.

## Adding Toolbox Functions

Are you missing a function in the toolbox? It's easy to implement it yourself!

It's even possible without a GPU, clone this repo and install it like this:

```
SETUP_PACKAGE=refact_scratchpads_no_gpu pip install -e refact/
```

In this folder `refact_scratchpads_no_gpu/gpt_toolbox/toolbox_functions` there are some
functions implemented using OpenAI API. There you can add a new one by analogy, or even
make an existing function better.

Add your new function to `infserver_no_gpu.py` and `modelcap_records.py`.

To test your function, run `infserver_no_gpu` as in the previous section.


## Simplifying Toolbox (WORK IN PROGRESS)

1. Toolbox for models with GPU https://github.com/smallcloudai/refact/pull/33

2. Simplify functions list, so you don't have to touch `infserver_no_gpu.py` and `modelcap_records` (no PR yet)
UPDATE: toolbox is under reconstruction.


## Install Linguist
Expand Down
9 changes: 3 additions & 6 deletions refact_scratchpads_no_gpu/stream_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,9 @@ def test_head_and_tail():
class UploadProxy:
def __init__(
self,
upload_q: Optional[multiprocessing.Queue],
cancelled_q: Optional[multiprocessing.Queue],
upload_q: Optional[multiprocessing.Queue] = None,
cancelled_q: Optional[multiprocessing.Queue] = None,
):
try:
multiprocessing.set_start_method("spawn")
except: # it could be already set
pass
self.upload_q = upload_q or multiprocessing.Queue()
self.cancelled_q = cancelled_q or multiprocessing.Queue()
self.proc = None
Expand All @@ -161,6 +157,7 @@ def start_upload_result_daemon(self):
target=_upload_results_loop,
args=(self.upload_q, self.cancelled_q),
name="upload_results",
daemon=True
)
self.proc.start()
return self.proc
Expand Down