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

openai API paid usage #9

Open
jayypaul opened this issue Jan 15, 2024 · 1 comment
Open

openai API paid usage #9

jayypaul opened this issue Jan 15, 2024 · 1 comment

Comments

@jayypaul
Copy link

Hello,

I currently have a free account but I'm unsure what tier I would need to upgrade to in order to run:

test_array_seq = get_seq_embed_gpt(
    sp_adata.X,
    np.array(sp_adata.var.index), 
    prompt_prefix = 'A cell with genes ranked by expression: '
    # trunc_index=N_TRUNC_GENE
)
test_array_seq

cell_gpt = []
for x in test_array_seq:
    cell_gpt.append(get_gpt_embedding(x))
cell_gpt = np.array(cell_gpt)

I'd like to get cell embeddings similarly to the aorta analysis for removing batch effect variability. I have about 130,000 cells and 978 genes (pre filtering zero genes).

I'm not too familiar with the verbage used to describe the billing associated with the different tiers of openai. Any suggestions with how much it might cost to run this analysis? Any thoughts or comments would be greatly appreciated!

@jayypaul
Copy link
Author

I went ahead and paid a little bit to see how much the algorithm will cost.

After about an hour of running I received this error:

Traceback (most recent call last):
File "", line 2, in
File "", line 3, in get_gpt_embedding
File "/home/jaaayy/miniconda3/envs/foundation_models/lib/python3.9/site-packages/openai/api_resources/embedding.py", line 33, in create
response = super().create(*args, **kwargs)
File "/home/jaaayy/miniconda3/envs/foundation_models/lib/python3.9/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/home/jaaayy/miniconda3/envs/foundation_models/lib/python3.9/site-packages/openai/api_requestor.py", line 298, in request
resp, got_stream = self._interpret_response(result, stream)
File "/home/jaaayy/miniconda3/envs/foundation_models/lib/python3.9/site-packages/openai/api_requestor.py", line 700, in _interpret_response
self._interpret_response_line(
File "/home/jaaayy/miniconda3/envs/foundation_models/lib/python3.9/site-packages/openai/api_requestor.py", line 745, in _interpret_response_line
raise error.ServiceUnavailableError(
openai.error.ServiceUnavailableError: The server is overloaded or not ready yet.

it ended up outputting (24818, 1536) numpy array for my request anyways.. not sure what the 1536 refers to, but I imagine it was able to process 24818 out of about 130,000 cells that I requested. do you have an idea of what the upper limit of cells & genes may be? I see in the paper that the integration tasks were typically done with < 10,000 cells I believe. Also, Is there a way to avoid these situations so that I'm not charged for something that doesn't run successfully?

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

No branches or pull requests

1 participant