{"id":21358651,"url":"https://github.com/alinuxperson/synthtext","last_synced_at":"2025-03-16T06:17:22.808Z","repository":{"id":137535214,"uuid":"449961096","full_name":"ALinuxPerson/synthtext","owner":"ALinuxPerson","description":"A program which wraps the TextSynth API.","archived":false,"fork":false,"pushed_at":"2022-01-22T11:43:25.000Z","size":413,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T18:36:17.339Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ALinuxPerson.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-20T05:02:25.000Z","updated_at":"2023-01-15T12:25:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"59835c89-5859-4ecd-8851-a49afa719f6e","html_url":"https://github.com/ALinuxPerson/synthtext","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Fsynthtext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Fsynthtext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Fsynthtext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Fsynthtext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ALinuxPerson","download_url":"https://codeload.github.com/ALinuxPerson/synthtext/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830954,"owners_count":20354856,"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-22T05:20:59.405Z","updated_at":"2025-03-16T06:17:22.792Z","avatar_url":"https://github.com/ALinuxPerson.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e\u003cb\u003eSynthText\u003c/b\u003e\u003c/h1\u003e\n    \u003cp\u003eA (unofficial) program which wraps the \u003ca href=\"https://textsynth.com\"\u003eTextSynth API\u003c/a\u003e, an API which can generate text from an input.\u003c/p\u003e\n\u003c/div\u003e\n\n# Usage\n\n*Note: according to the gifs, it seems like the string \"synthtext\" is printed onto the screen, but it's not. It's likely\na bug with `asciicast2gif`.*\n\n## Setup\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/config-generate.gif\" width=\"640\" height=\"480\" alt=\"Configuration generation\"\u003e\n\u003c/p\u003e\n\nFirst things first, you need an API key from [TextSynth]. You can get one by [signing up] on their website. After you've\nverified your email, you'll get your API key (for free!).\n\nAfter this, you must generate a configuration file. This way, you don't have to pass in the API key everytime.\n\nRun this command:\n\n```bash\n$ synthtext config generate --api-key=\u003cyour-api-key\u003e\n```\n\nDon't worry about a warning about the parent directory not existing. It's normal, and it'll be created for you!\n\nYou can also pass a model (or engine definition as we like to call it around here) to your configuration file, however \nthat will be covered later.\n\nLet's get started!\n\n## Generating text\n\nIn order to generate text, at the very minimum, you must pass an input text or \"prompt\". This is the text that will be\nfed into the API. You must also first choose the method of delivering the text to you.\n\n### Now\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/text-completion-now.gif\" width=\"640\" height=\"480\" alt=\"Immediate text completion\"\u003e\n\u003c/p\u003e\n\nThe first method, **now**, will display the text immediately to you (after the request is completed, of course!).\n\n```bash\n$ synthtext text-completion $prompt now\n```\n\n### Stream\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/text-completion-stream.gif\" width=\"640\" height=\"480\" alt=\"Streaming text completion\"\u003e\n\u003c/p\u003e\n\nThe second method, **stream**, will send the text in chunks as they're generated on the fly.\n\n```bash\n$ synthtext text-completion $prompt stream\n```\n\nThere are many other arguments that the `text-completion` subcommand accepts. To see those, pass the `--help` flag.\n\n## Log probabilities\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/log-probabilities.gif\" width=\"640\" height=\"480\" alt=\"Log probabilities\"\u003e\n\u003c/p\u003e\n\nI'll admit, most people *probably* don't have a use case for this. Neither do I! However, you can see what the \n[API Documentation](https://textsynth.com/documentation.html#logprob) thinks about it:\n\n\u003e This endpoint returns the logarithm of the probability that a `continuation` is generated after a `context`. It can be\n\u003e used to answer questions when only a few answers (such as yes/no) are possible. It can also be used to benchmark the\n\u003e models.\n\nIn order to get the... logarithm of the probability you need at a minimum 2 arguments:\n  - The **context**, the text to get match against, and\n  - the **continuation**, the text that you want to know the logarithm of the probability of. Only accepts non-empty \n    strings.\n\nRun this command like so:\n\n```bash\n$ synthtext log-probabilities \"$context\" \"$continuation\"\n```\n\n## Engine definitions\n\nThese are the metadata which is passed on to the API which is used to generate text. There are three types of officially\nsupported engine definitions (at least by [`textsynth`]): \n\n  - **GPT J 6B**: This is the default engine used when no engine definition is specified in the configuration. It is known to this program as \"GptJ6B\". \n    According to the documentation, it is:\n    \u003e [GPT-J] is a language model with 6 billion parameters trained on [the Pile] (825 GB of text data) published by\n    \u003e [EleutherAI]. Its main language is English but it is also fluent in several other languages. It is also trained on\n    \u003e several computer languages.\n  - **Boris 6B**: It is known to the program as \"Boris6B\". According to the documentation, it is:\n    \u003e [Boris] is a fine tuned version of GPT-J for the French language. Use this model is you want the best performance\n    \u003e with the French language.\n  - **Fairseq GPT 13B**: It is known to the program as \"FairseqGPT13B\". Do note that this engine definition doesn't\n    always work. According to the documentation, it is:\n    \u003e [Fairseq GPT 13B] is the largest publically available English model with 13 billion parameters. Its training\n    \u003e corpus is less diverse than GPT-J but it has better performance at least on pure English language tasks. *Note:\n    \u003e support of this model is still experimental. It may stop working without notice.*\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/config-find-path.gif\" width=\"640\" height=\"480\" alt=\"Log probabilities\"\u003e\n\u003c/p\u003e\n    \nIn order to use these engine definitions, you must find the configuration file and edit it to include the engine \ndefinition. To find it, run this command:\n\n```bash\n$ synthtext config find-path\n```\n\nThe key is `engine_definition`. Edit it like so. For example, if you want to set the engine definitions to Boris 6B, \nedit the configuration like this:\n\n```json\n{\n  \"api_key\": \"\u003cREDACTED\u003e\",\n  \"engine_definition\": \"Boris6B\"\n}\n```\n\n# Library\nThe underlying library that this project uses is the [`textsynth`] library.\n\n# License\nThis project is licensed under the [MIT license].\n\n[MIT License]: LICENSE\n[`textsynth`]: https://crates.io/textsynth\n[TextSynth]: https://textsynth.com\n[signing up]: https://textsynth.com/signup.html\n[GPT-J]: https://github.com/kingoflolz/mesh-transformer-jax/#gpt-j-6b\n[the Pile]: https://pile.eleuther.ai/\n[EleutherAI]: https://www.eleuther.ai/\n[Boris]: https://github.com/coteries/cedille-ai\n[Fairseq GPT 13B]: https://github.com/pytorch/fairseq/tree/main/examples/moe_lm","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falinuxperson%2Fsynthtext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falinuxperson%2Fsynthtext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falinuxperson%2Fsynthtext/lists"}