{"id":19815976,"url":"https://github.com/replicate/all-mpnet-base-v2","last_synced_at":"2025-05-01T10:32:02.039Z","repository":{"id":185469514,"uuid":"629574128","full_name":"replicate/all-mpnet-base-v2","owner":"replicate","description":"A cog model for the all-mpnet-base-v2 sentence-transformers embedding model. ","archived":false,"fork":false,"pushed_at":"2024-01-03T18:36:59.000Z","size":25,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-01-03T19:38:52.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://replicate.com/replicate/all-mpnet-base-v2","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/replicate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-18T15:27:36.000Z","updated_at":"2023-12-31T18:10:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"751a30e0-451b-4608-99b1-11f6326a9e6b","html_url":"https://github.com/replicate/all-mpnet-base-v2","commit_stats":null,"previous_names":["replicate/all-mpnet-base-v2"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fall-mpnet-base-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fall-mpnet-base-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fall-mpnet-base-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fall-mpnet-base-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replicate","download_url":"https://codeload.github.com/replicate/all-mpnet-base-v2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224253515,"owners_count":17280932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T10:07:55.366Z","updated_at":"2024-11-12T10:07:55.975Z","avatar_url":"https://github.com/replicate.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# all-mpnet-base-v2\n\nThis is a cog model for the `all-mpnet-base-v2` sentence-transformers embedding model. This embedding model is based on [MPNet](https://arxiv.org/abs/2004.09297) and fine-tuned on 1 billion sentence pairs (see [here](https://huggingface.co/sentence-transformers/all-mpnet-base-v2#:~:text=seb.sbert.net-,Background,-The%20project%20aims) for details). \n\n\n## How to setup the cog model\n\n### Prerequisites\n\nGPU machine. You'll need a Linux machine with an NVIDIA GPU attached and the NVIDIA Container Toolkit installed. If you don't already have access to a machine with a GPU, check out our guide to getting a GPU machine.\n\nDocker. You'll be using the Cog command-line tool to build and push a model. Cog uses Docker to create containers for models.\n\n### Step 0: Install Cog\nFirst, install Cog:\n\n```\nsudo curl -o /usr/local/bin/cog -L \"https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)\"\nsudo chmod +x /usr/local/bin/cog\n```\n\n### Step 1: Set up weights\n\nFrom the root directory of this repo, run: \n\n```\nchmod +x scripts/download_and_prepare_model.py\ncog run python scripts/download_and_prepare_model.py --config model_setup.yaml \n```\n\n### Step 2: Run the model\n\nYou can run the model locally to test it:\n```\ncog predict -i text=\"You may know a word by the company it keeps.\"\n```\n\nMake sure to specify \"private\" to keep the model private.\n\n### Step 4: Configure the model to run on either GPU or CPU.\n\nReplicate supports running models on CPU or a variety of GPUs. The default GPU type is a T4 and that may be sufficient; however, for maximal batch side and performance, you may want to consider more performant GPUs like A100s.\n\nAlternatively, if you will only be encoding single documents and you want to minimze spend at the cost of latency, you can run this model on CPU. You'll observe higher latencies, but this may be acceptable for your use case.\n\nClick on the \"Settings\" tab on your model page, scroll down to \"GPU hardware\", and select \"A100\". Then click \"Save\".\n\n### Step 5: Push the model to Replicate\nLog in to Replicate:\n```\ncog login\n```\n\nPush the contents of your current directory to Replicate, using the model name you specified in step 3:\n```\ncog push r8.im/username/modelname\n```\n\nLearn more about pushing models to Replicate.\n\n### Step 6: Run the model on Replicate\nNow that you've pushed the model to Replicate, you can run it from the website or with an API.\n\nTo use your model in the browser, go to your model page.\n\nTo use your model with an API, click on the \"API\" tab on your model page. You'll see commands to run the model with cURL, Python, etc.\n\nTo learn more about how to use Replicate, check out our documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fall-mpnet-base-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplicate%2Fall-mpnet-base-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fall-mpnet-base-v2/lists"}