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

summaries: refactor to use openai api model for inference #59

Merged
merged 7 commits into from
Mar 1, 2024

Conversation

saghul
Copy link
Member

@saghul saghul commented Feb 16, 2024

No description provided.

skynet/modules/ttt/summaries/processor.py Show resolved Hide resolved
skynet/env.py Outdated Show resolved Hide resolved
skynet/modules/ttt/openai_api/app.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/processor.py Outdated Show resolved Hide resolved
@quitrk quitrk changed the title Tavram/openai summaries: refactor to use openai api model for inference Feb 20, 2024
@quitrk quitrk force-pushed the tavram/openai branch 2 times, most recently from 9db544d to 28c7987 Compare February 23, 2024 14:17
Copy link
Member Author

@saghul saghul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, PTAL. It's not clear to me how the 2 ways of running the OpenAI-compat app are attained. Wasn't the executor going to hit an internal OpenAI-compat service locally bypassing auth?

skynet/modules/ttt/openai_api/app.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/jobs.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/processor.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/processor.py Show resolved Hide resolved
skynet/modules/ttt/summaries/processor.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/prompts/summary.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/v1/router.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/v1/router.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/v1/router.py Outdated Show resolved Hide resolved
@quitrk quitrk force-pushed the tavram/openai branch 2 times, most recently from ea480d4 to 256d58a Compare February 27, 2024 13:41
skynet/auth/bearer.py Show resolved Hide resolved
skynet/main.py Show resolved Hide resolved
skynet/modules/ttt/summaries/v1/models.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/v1/router.py Show resolved Hide resolved
skynet/utils.py Outdated Show resolved Hide resolved
* inference jobso of customers with existing open ai keys will run on open ai servers
Copy link
Member Author

@saghul saghul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, PTAL!

skynet/auth/openai.py Outdated Show resolved Hide resolved
open_yaml(openai_credentials_file)
file_watcher = FileWatcher(openai_credentials_file, lambda: open_yaml(openai_credentials_file))

file_watcher.start()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When are we going to stop this?

Copy link
Collaborator

@quitrk quitrk Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when the process stops. Is there other time when we'd want it to stop?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, in general I prefer explicit vs implicit. No big deal though.

skynet/auth/openai.py Outdated Show resolved Hide resolved
skynet/auth/openai.py Outdated Show resolved Hide resolved
skynet/modules/file_watcher.py Outdated Show resolved Hide resolved
log.error(f'Error while polling for file changes: {e}')
break

def start(self):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there should be a stop here...

skynet/modules/ttt/summaries/app.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/jobs.py Outdated Show resolved Hide resolved
skynet/modules/ttt/summaries/jobs.py Outdated Show resolved Hide resolved
n_ctx=4096,
n_gpu_layers=llama_n_gpu_layers,
n_batch=llama_n_batch,
global llm
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this initialize necessary? Can't we just create it at imprt time?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we move it like that, we need to also better isolate the summaries:dispatcher module to make sure it's not importing it indirectly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the dispatcher import anything from the processor? It kinda shouldn't.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it imports the jobs module, which in turn has reference to the processor

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. No strong opinion then.

Copy link
Member Author

@saghul saghul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, excellent work! Since I opened the PR you need to approve it yourself lol

@saghul
Copy link
Member Author

saghul commented Feb 29, 2024

Pl squash-merge.

@quitrk quitrk merged commit a0e7683 into master Mar 1, 2024
@quitrk quitrk deleted the tavram/openai branch March 1, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants