{"id":24556088,"url":"https://github.com/deepfates/concat","last_synced_at":"2025-03-16T17:46:07.227Z","repository":{"id":243128312,"uuid":"811115291","full_name":"deepfates/concat","owner":"deepfates","description":"query, rank and answer questions from a bookwyrm 🐈‍⬛","archived":false,"fork":false,"pushed_at":"2024-06-10T18:13:20.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T04:38:16.312Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepfates.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-06T00:57:01.000Z","updated_at":"2024-08-28T03:44:28.000Z","dependencies_parsed_at":"2024-06-10T20:29:55.688Z","dependency_job_id":"7005e2a3-b164-4f28-b022-0e49dd47da06","html_url":"https://github.com/deepfates/concat","commit_stats":null,"previous_names":["deepfates/concat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepfates%2Fconcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepfates%2Fconcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepfates%2Fconcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepfates%2Fconcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepfates","download_url":"https://codeload.github.com/deepfates/concat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910714,"owners_count":20367538,"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":"2025-01-23T04:38:19.605Z","updated_at":"2025-03-16T17:46:07.199Z","avatar_url":"https://github.com/deepfates.png","language":"Python","readme":"# 🐈‍⬛ concat\n\nThis is a simple retrieval chat api. It takes a Bookwyrm object and a text query, does similarity search to find relevant docs, and outputs a synthetic answer with citations.\n\nTo use, create a virtual environment and install requirements with pip.\n\nHere's how you can use concat with the [bookwyrm](https://github.com/deepfates/bookwyrm) model you created:\n\n```python\nfrom concat.concat import load_model, get_full_answer\n\n# Load the Bookwyrm model\nmodel = load_model(\"wyrm.json\")\n\n# Ask a query\nquery = \"What is the meaning of life?\"\n\n# Get the answer\nanswer = \"\".join(get_full_answer(model, query))\nprint(answer)\n```\n\nThis will:\n\n1. Load the `bookwyrm` model from the `wyrm.json` file you created.\n2. Process the query \"What is the capital of France?\" to get its embedding.\n3. Find the most similar chunks in the model to the query embedding.\n4. Generate a prompt with the query and relevant chunks.\n5. Use the `meta/meta-llama-3-8b-instruct` model to generate an answer based on the prompt.\n6. Print out the full answer with citations.\n\nTo use `concat` with Replicate, update the `predict.py` file:\n\n```python\nfrom concat.concat import load_model, get_full_answer\n\nclass Predictor(BasePredictor):\n    def setup(self):\n        self.model = load_model(\"wyrm.json\")\n\n    def predict(self, query: str) -\u003e str:\n        return \"\".join(get_full_answer(self.model, query))\n```\n\nThen build and push to Replicate as shown in the README.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepfates%2Fconcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepfates%2Fconcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepfates%2Fconcat/lists"}