Comments (3)
@vadi2 yes :)
You can use a local postgres for example
First, run Docker, then:
docker run -d --name pgvector -p 8080:8080 -p 5432:5432 \
-e POSTGRES_DB=embedbase -e POSTGRES_PASSWORD=localdb \
-v data:/var/lib/postgresql/data ankane/pgvector
This will start a Docker container with an image that can handle vector data type and semantic search queries
You can then use either OpenAI to create embeddings like so:
# main.py
import os
from embedbase import get_app
from embedbase.database.postgres_db import Postgres
from embedbase.embedding.openai import OpenAI
import uvicorn
# get api key here https://platform.openai.com/account/api-keys
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
app = (
get_app()
.use_embedder(OpenAI(OPENAI_API_KEY))
.use_db(Postgres())
.run()
)
if __name__ == "__main__":
uvicorn.run("main:app", reload=True)
Make sure to install the dependencies pip install embedbase uvicorn
, then you can start Embedbase:
python3 main.py
Make sure to replace references to "https://embedbase-hosted-usx5gpslaq-uc.a.run.app/v1/documentation" to "http://localhost:8000/v1/documentation" in your javascript/ts code.
We recommend using the SDK, although this tutorial does not use the SDK yet, we will update it ASAP.
You can also run a local Embedbase with a custom "embedder" such as sentence transformer as explained here if you want to keep everything local.
Please let me know if that solve your issue
from embedbase.
@vadi2
If you don't want to use Docker, you can also go with in memory database:
import uvicorn
from embedbase import get_app
from embedbase.database.memory_db import MemoryDatabase
from embedbase.embedding.openai import OpenAI
app = (
get_app()
.use_embedder(OpenAI("<your key>"))
.use_db(MemoryDatabase())
).run()
if __name__ == "__main__":
uvicorn.run("main:app")
from embedbase.
@vadi2 feel free to reopen the issue with if you have any other problems 😃
from embedbase.
Related Issues (20)
- [Dashboard]: chat kept in state
- [Dashboard, Core, Python SDK, Javascript SDK]: publish appropriate changelog on release
- [Python SDK, Javascript SDK]: improve error handling HOT 1
- [Dashboard, Core, Python SDK, Javascript SDK]: integration unit tests concurrency issue HOT 1
- [Python SDK]: async combining two dataset doesn't work after python SDK update HOT 3
- [Core]: ValueError: Out of range float values are not JSON compliant HOT 3
- [Core]: add response model
- [Core]: tiktoken stackoverflow
- [Python SDK]: ImportError: cannot import name 'EmbedbaseAsyncClient' from 'embedbase_client' HOT 1
- [Python SDK]: Where implementation in postgres db HOT 1
- [Core]: YamlModel is a deprecated class in pydantic_yaml HOT 1
- merge docs apis into a single one using wasm hacks HOT 1
- Intermittent playground crash HOT 7
- Getting started examples
- async function call not working (uvicorn, fastapi) HOT 10
- ValueError: Out of range float values are not JSON compliant HOT 2
- Add references to github and pdf uploader
- metadata unicode issue with supabase
- Add .ratio to embedbase sdk HOT 3
- [Core/Hosted]: search feedback HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embedbase.