{"id":24617726,"url":"https://github.com/jacoblincool/gradio-rs","last_synced_at":"2025-05-07T05:25:13.694Z","repository":{"id":249723503,"uuid":"832343917","full_name":"JacobLinCool/gradio-rs","owner":"JacobLinCool","description":"Gradio Client in Rust.","archived":false,"fork":false,"pushed_at":"2024-10-12T11:02:37.000Z","size":310,"stargazers_count":28,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T06:51:09.183Z","etag":null,"topics":["cli","client","gradio","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/gradio","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/JacobLinCool.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":"2024-07-22T20:41:29.000Z","updated_at":"2025-03-24T01:08:43.000Z","dependencies_parsed_at":"2024-07-23T00:59:42.371Z","dependency_job_id":null,"html_url":"https://github.com/JacobLinCool/gradio-rs","commit_stats":null,"previous_names":["jacoblincool/gradio-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fgradio-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fgradio-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fgradio-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fgradio-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JacobLinCool","download_url":"https://codeload.github.com/JacobLinCool/gradio-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252819712,"owners_count":21809071,"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":["cli","client","gradio","rust"],"created_at":"2025-01-24T23:40:14.446Z","updated_at":"2025-05-07T05:25:13.676Z","avatar_url":"https://github.com/JacobLinCool.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gradio-rs\n\nGradio Client in Rust.\n\n![demo gif](./images/demo.gif)\n\n## Features\n\n- [x] View API\n- [x] Upload file\n- [x] Make prediction\n  - [x] The blocking `predict` method\n  - [x] The non-blocking `submit` method\n- [x] Command-line interface\n- [x] Synchronous and asynchronous API\n\n\u003e Supposed to work with Gradio 5 \u0026 4, other versions are not tested.\n\n## Documentation\n\n- [API Documentation](https://docs.rs/gradio)\n- [Examples](./examples/)\n\n## Usage\n\nSee the [examples](./examples/) directory for more examples.\n\nHere is an example of using `BS-RoFormer` model to separate vocals and background music from an audio file.\n\n```rust\nuse gradio::{PredictionInput, Client, ClientOptions};\n\n#[tokio::main]\nasync fn main() {\n    if std::env::args().len() \u003c 2 {\n        println!(\"Please provide an audio file path as an argument\");\n        std::process::exit(1);\n    }\n    let args: Vec\u003cString\u003e = std::env::args().collect();\n    let file_path = \u0026args[1];\n    println!(\"File: {}\", file_path);\n\n    let client = Client::new(\"JacobLinCool/vocal-separation\", ClientOptions::default())\n        .await\n        .unwrap();\n\n    let output = client\n        .predict(\n            \"/separate\",\n            vec![\n                PredictionInput::from_file(file_path),\n                PredictionInput::from_value(\"BS-RoFormer\"),\n            ],\n        )\n        .await\n        .unwrap();\n    println!(\n        \"Vocals: {}\",\n        output[0].clone().as_file().unwrap().url.unwrap()\n    );\n    println!(\n        \"Background: {}\",\n        output[1].clone().as_file().unwrap().url.unwrap()\n    );\n}\n```\n\nSee [./examples/sd3.rs](./examples/sd3.rs) for non-blocking example with `submit` method.\n\n## Command-line Interface\n\n```sh\ncargo install gradio\ngr --help\n```\n\nTake `stabilityai/stable-diffusion-3-medium` HF Space as an example:\n\n```sh\n\u003e gr list stabilityai/stable-diffusion-3-medium\nAPI Spec for stabilityai/stable-diffusion-3-medium:\n        /infer\n                Parameters:\n                        prompt               ( str      ) \n                        negative_prompt      ( str      ) \n                        seed                 ( float    ) numeric value between 0 and 2147483647\n                        randomize_seed       ( bool     ) \n                        width                ( float    ) numeric value between 256 and 1344\n                        height               ( float    ) numeric value between 256 and 1344\n                        guidance_scale       ( float    ) numeric value between 0.0 and 10.0\n                        num_inference_steps  ( float    ) numeric value between 1 and 50\n                Returns:\n                        Result               ( filepath ) \n                        Seed                 ( float    ) numeric value between 0 and 2147483647\n\n\u003e gr run stabilityai/stable-diffusion-3-medium infer 'Rusty text \"AI \u0026 CLI\" on the snow.' '' 0 true 1024 1024 5 28\nResult: https://stabilityai-stable-diffusion-3-medium.hf.space/file=/tmp/gradio/5735ca7775e05f8d56d929d8f57b099a675c0a01/image.webp\nSeed: 486085626\n```\n\nFor file input, simply use the file path as the argument:\n\n```sh\ngr run hf-audio/whisper-large-v3 predict 'test-audio.wav' 'transcribe'\noutput: \" Did you know you can try the coolest model on your command line?\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fgradio-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacoblincool%2Fgradio-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fgradio-rs/lists"}