openai-cookbook
openai-cookbook copied to clipboard
Visualizing Embeddings with Atlas
An example notebook that showcases how to visualize and summarize OpenAI embeddings using Atlas
@logankilpatrick Are their any changes needed to get this example notebook merged?
Bumping this @logankilpatrick . Are their any changes needed to get this example notebook merged?
If no one else gets to this, I'll commit to take a look next week. Apologies for the delays and thanks for your patience. We really do appreciate your contribution.
Thank you @ted-at-openai !
太垃圾
郭学胜到此一游
掉毛
guoxueshengCome here, a group of spicy chicken
Now that GPT-4 has launched, I now have time to get to this. Thanks for your patience over the past few weeks. :)
I tried running the example, but hit an error using the provided demo key:
2023-03-16 16:01:40.239 | INFO | nomic.project:_create_project:932 - Creating project `futuristic-email` in organization `Atlas Demo`
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
[/var/folders/r4/x3kdvs816995fnnph2gdpwp40000gn/T/ipykernel_11410/3810895700.py](https://file+.vscode-resource.vscode-cdn.net/var/folders/r4/x3kdvs816995fnnph2gdpwp40000gn/T/ipykernel_11410/3810895700.py) in
4
5 data = df.to_dict('records')
----> 6 project = atlas.map_embeddings(embeddings=embeddings, data=data,
7 id_field='id',
8 colorable_fields=['Score'])
[~/.virtualenvs/openai/lib/python3.9/site-packages/nomic/atlas.py](https://file+.vscode-resource.vscode-cdn.net/Users/ted/code/openai-cookbook/examples/~/.virtualenvs/openai/lib/python3.9/site-packages/nomic/atlas.py) in map_embeddings(embeddings, data, id_field, name, description, is_public, colorable_fields, build_topic_model, topic_label_field, num_workers, organization_name, reset_project_if_exists, add_datums_if_exists, shard_size, projection_n_neighbors, projection_epochs, projection_spread)
80 data = [{} for _ in range(len(embeddings))]
81
---> 82 project = AtlasProject(
83 name=project_name,
84 description=description,
[~/.virtualenvs/openai/lib/python3.9/site-packages/nomic/project.py](https://file+.vscode-resource.vscode-cdn.net/Users/ted/code/openai-cookbook/examples/~/.virtualenvs/openai/lib/python3.9/site-packages/nomic/project.py) in __init__(self, name, description, unique_id_field, modality, organization_name, is_public, project_id, reset_project_if_exists, add_datums_if_exists)
866 raise ValueError("You must specify a modality when creating a new project.")
867
--> 868 project_id = self._create_project(
869 project_name=name,
870 description=description,
[~/.virtualenvs/openai/lib/python3.9/site-packages/nomic/project.py](https://file+.vscode-resource.vscode-cdn.net/Users/ted/code/openai-cookbook/examples/~/.virtualenvs/openai/lib/python3.9/site-packages/nomic/project.py) in _create_project(self, project_name, description, unique_id_field, modality, organization_name, is_public)
945 )
946 if response.status_code != 201:
--> 947 raise Exception(f"Failed to create project: {response.json()}")
948
949 return response.json()['project_id']
Exception: Failed to create project: {'detail': 'To many projects exist. Delete projects to create a new one.'}
Is there a way to fix this so folks don't hit an error when they run it for the first time?
Should be fixed now!
@ted-at-openai Looking forward to your review!
Awesome, it works now.
Looks great and I'm happy to merge. Can I ask for one small change before merging:
- Change name to
Visualizing_embeddings_with_Atlas.ipynb
The benefit of this name is that this way all of the embedding visualization examples will go together when listed alphabetically.
Renamed!
Sweet. Merging now. Thanks for your patience with us (me).