Skip to content

Instantly share code, notes, and snippets.

@elijahbenizzy
Last active June 11, 2024 17:20
Show Gist options
  • Save elijahbenizzy/0181acef633ccfe5413dccefe5d01f10 to your computer and use it in GitHub Desktop.
Save elijahbenizzy/0181acef633ccfe5413dccefe5d01f10 to your computer and use it in GitHub Desktop.
def embedder() -> URLEmbedder:
env = rh.env(
name=f"langchain_embed_env",
reqs=[
"langchain",
"langchain-community",
"langchainhub",
"sentence_transformers",
"bs4"
],
)
cluster = rh.cluster(f"/dongreenberg/rh-hamilton-a10g",
instance_type="A10G:1",
auto_stop_mins=5,
spot=True).up_if_not()
RemoteURLEmbedder = rh.module(URLEmbedder).to(cluster, env)
return RemoteURLEmbedder(
model_name_or_path="BAAI/bge-large-en-v1.5",
device="cuda",
name=f"doc_embedder",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment