-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify an alias for a parameter #54
Comments
Hi! Unfortunately we haven't added alias support. If this is something important to you I could add it to my to-do list; I'd expect it to be straightforward. In the meantime, it is possible to rename an argument: import dataclasses
from pathlib import Path
import tyro
from typing_extensions import Annotated
@dataclasses.dataclass
class Args:
target_image: Annotated[Path, tyro.conf.arg(name="ti")]
# Takes --ti as an argument.
tyro.cli(Args) |
👀 hi running into the same issue. We have things like
|
Ok, @jhzgjhzg for your example: target_img: Annotated[Optional[Path], tyro.conf.arg(aliases=["--ti"])] = None @vwxyzjn for yours: temperature: Annotated[float, tyro.conf.arg(aliases=["-t])] = 1.0
max_new_tokens: Annotated[int, tyro.conf.arg(aliases=["-toks"]) = 1500 |
If a parameter name is too complex and I want to specify its abbreviation, how should I write it.
Similar to this:
parser.add_argument("--target_img", "--ti", required=False, help="Path of reference image.")
--target_img
and--ti
The text was updated successfully, but these errors were encountered: