Spaces:
Runtime error
Runtime error
derek-thomas
commited on
Commit
·
a6deb48
1
Parent(s):
7d97826
Upgrading to nomic 1.5
Browse files- app.py +1 -1
- src/utilities.py +1 -1
app.py
CHANGED
@@ -46,7 +46,7 @@ details_md = """
|
|
46 |
## Creation Details
|
47 |
1. This space is triggered by a webhook for changes on [derek-thomas/dataset-creator-reddit-bestofredditorupdates](https://huggingface.co/datasets/derek-thomas/dataset-creator-reddit-bestofredditorupdates).
|
48 |
2. It then takes the updates from that dataset and get embeddings by making leveraging [derek-thomas/nomic-embeddings](https://huggingface.co/spaces/derek-thomas/nomic-embeddings)
|
49 |
-
- [derek-thomas/nomic-embeddings](https://huggingface.co/spaces/derek-thomas/nomic-embeddings) is using [zero-spaces](https://huggingface.co/zero-gpu-explorers) a free GPU service
|
50 |
- Im calling this via [gradio_client](https://www.gradio.app/docs/client) which allows any space to be used as an API
|
51 |
3. The calculated embeddings are stored in this dataset [derek-thomas/reddit-bestofredditorupdates-processed](https://huggingface.co/datasets/derek-thomas/reddit-bestofredditorupdates-processed)
|
52 |
4. These get visualized by [nomic atlas](https://docs.nomic.ai/atlas/introduction/quick-start). You can see how I process it in [build_nomic.py](https://huggingface.co/spaces/derek-thomas/processing-bestofredditorupdates/blob/main/src/build_nomic.py)
|
|
|
46 |
## Creation Details
|
47 |
1. This space is triggered by a webhook for changes on [derek-thomas/dataset-creator-reddit-bestofredditorupdates](https://huggingface.co/datasets/derek-thomas/dataset-creator-reddit-bestofredditorupdates).
|
48 |
2. It then takes the updates from that dataset and get embeddings by making leveraging [derek-thomas/nomic-embeddings](https://huggingface.co/spaces/derek-thomas/nomic-embeddings)
|
49 |
+
- [derek-thomas/nomic-embeddings](https://huggingface.co/spaces/derek-thomas/nomic-embeddings) is using [zero-spaces](https://huggingface.co/zero-gpu-explorers) a free GPU service to compute the model [nomic-ai/nomic-embed-text-v1.5](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5)
|
50 |
- Im calling this via [gradio_client](https://www.gradio.app/docs/client) which allows any space to be used as an API
|
51 |
3. The calculated embeddings are stored in this dataset [derek-thomas/reddit-bestofredditorupdates-processed](https://huggingface.co/datasets/derek-thomas/reddit-bestofredditorupdates-processed)
|
52 |
4. These get visualized by [nomic atlas](https://docs.nomic.ai/atlas/introduction/quick-start). You can see how I process it in [build_nomic.py](https://huggingface.co/spaces/derek-thomas/processing-bestofredditorupdates/blob/main/src/build_nomic.py)
|
src/utilities.py
CHANGED
@@ -61,5 +61,5 @@ def merge_and_update_datasets(dataset, original_dataset):
|
|
61 |
|
62 |
|
63 |
def update_embeddings(content, client):
|
64 |
-
embedding = client.predict(content, api_name="/embed")
|
65 |
return np.array(embedding)
|
|
|
61 |
|
62 |
|
63 |
def update_embeddings(content, client):
|
64 |
+
embedding = client.predict('search_document: ' + content, api_name="/embed")
|
65 |
return np.array(embedding)
|