gitarsenal-cli 1.9.17 ā 1.9.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.venv_status.json +1 -1
- package/package.json +1 -1
- package/python/test_modalSandboxScript.py +21 -186
- package/test_modalSandboxScript.py +21 -186
package/.venv_status.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"created":"2025-08-06T08:
|
|
1
|
+
{"created":"2025-08-06T08:11:48.991Z","packages":["modal","gitingest","requests","anthropic"],"uv_version":"uv 0.8.4 (Homebrew 2025-07-30)"}
|
package/package.json
CHANGED
|
@@ -2016,43 +2016,6 @@ Provide fixes for all {len(failed_commands)} failed commands:"""
|
|
|
2016
2016
|
print(f"ā Error during batch debugging: {e}")
|
|
2017
2017
|
return []
|
|
2018
2018
|
|
|
2019
|
-
def prompt_for_hf_token():
|
|
2020
|
-
"""Prompt user for Hugging Face token when needed"""
|
|
2021
|
-
# Try to use credentials manager first
|
|
2022
|
-
try:
|
|
2023
|
-
from credentials_manager import CredentialsManager
|
|
2024
|
-
credentials_manager = CredentialsManager()
|
|
2025
|
-
token = credentials_manager.get_huggingface_token()
|
|
2026
|
-
if token:
|
|
2027
|
-
return token
|
|
2028
|
-
except ImportError:
|
|
2029
|
-
# Fall back to direct input if credentials_manager is not available
|
|
2030
|
-
pass
|
|
2031
|
-
|
|
2032
|
-
# Traditional direct input method as fallback
|
|
2033
|
-
print("\n" + "="*60)
|
|
2034
|
-
print("š HUGGING FACE TOKEN REQUIRED")
|
|
2035
|
-
print("="*60)
|
|
2036
|
-
print("The training script requires a valid Hugging Face token.")
|
|
2037
|
-
print("You can get your token from: https://huggingface.co/settings/tokens")
|
|
2038
|
-
print("š Please paste your Hugging Face token below:")
|
|
2039
|
-
print(" (Your input will be hidden for security)")
|
|
2040
|
-
print("-" * 60)
|
|
2041
|
-
|
|
2042
|
-
try:
|
|
2043
|
-
token = getpass.getpass("HF Token: ").strip()
|
|
2044
|
-
if not token:
|
|
2045
|
-
print("ā No token provided.")
|
|
2046
|
-
return None
|
|
2047
|
-
print("ā
Token received successfully!")
|
|
2048
|
-
return token
|
|
2049
|
-
except KeyboardInterrupt:
|
|
2050
|
-
print("\nā Token input cancelled by user.")
|
|
2051
|
-
return None
|
|
2052
|
-
except Exception as e:
|
|
2053
|
-
print(f"ā Error getting token: {e}")
|
|
2054
|
-
return None
|
|
2055
|
-
|
|
2056
2019
|
def generate_random_password(length=16):
|
|
2057
2020
|
"""Generate a random password for SSH access"""
|
|
2058
2021
|
alphabet = string.ascii_letters + string.digits + "!@#$%^&*"
|
|
@@ -2067,9 +2030,10 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
|
2067
2030
|
|
|
2068
2031
|
# Use interactive mode if specified
|
|
2069
2032
|
if interactive:
|
|
2070
|
-
# If GPU type is not specified,
|
|
2033
|
+
# If GPU type is not specified, use default
|
|
2071
2034
|
if not gpu_type:
|
|
2072
|
-
gpu_type =
|
|
2035
|
+
gpu_type = "A10G"
|
|
2036
|
+
print(f"ā
Using default GPU type: {gpu_type}")
|
|
2073
2037
|
else:
|
|
2074
2038
|
print(f"ā
Using provided GPU type: {gpu_type}")
|
|
2075
2039
|
|
|
@@ -3746,150 +3710,7 @@ def get_setup_commands_from_gitingest(repo_url):
|
|
|
3746
3710
|
print("ā All API endpoints failed")
|
|
3747
3711
|
return generate_fallback_commands(gitingest_data)
|
|
3748
3712
|
|
|
3749
|
-
|
|
3750
|
-
"""
|
|
3751
|
-
Prompt the user to select a GPU type from available options using arrow keys.
|
|
3752
|
-
Returns the selected GPU type.
|
|
3753
|
-
"""
|
|
3754
|
-
import sys
|
|
3755
|
-
import tty
|
|
3756
|
-
import termios
|
|
3757
|
-
|
|
3758
|
-
print("\nš§ GPU Selection Required")
|
|
3759
|
-
print("No GPU type was specified with --gpu flag.")
|
|
3760
|
-
print("Please select a GPU type for your container:")
|
|
3761
|
-
|
|
3762
|
-
# Define available GPU types and their specifications
|
|
3763
|
-
gpu_specs = {
|
|
3764
|
-
'T4': {'gpu': 'T4', 'memory': '16GB'},
|
|
3765
|
-
'L4': {'gpu': 'L4', 'memory': '24GB'},
|
|
3766
|
-
'A10G': {'gpu': 'A10G', 'memory': '24GB'},
|
|
3767
|
-
'A100-40': {'gpu': 'A100-40GB', 'memory': '40GB'},
|
|
3768
|
-
'A100-80': {'gpu': 'A100-80GB', 'memory': '80GB'},
|
|
3769
|
-
'L40S': {'gpu': 'L40S', 'memory': '48GB'},
|
|
3770
|
-
'H100': {'gpu': 'H100', 'memory': '80GB'},
|
|
3771
|
-
'H200': {'gpu': 'H200', 'memory': '141GB'},
|
|
3772
|
-
'B200': {'gpu': 'B200', 'memory': '141GB'}
|
|
3773
|
-
}
|
|
3774
|
-
|
|
3775
|
-
# Create a list of options
|
|
3776
|
-
options = list(gpu_specs.keys())
|
|
3777
|
-
selected_index = 2 # Default to A10G (index 2)
|
|
3778
|
-
|
|
3779
|
-
def get_key():
|
|
3780
|
-
"""Get a single keypress from the user."""
|
|
3781
|
-
fd = sys.stdin.fileno()
|
|
3782
|
-
old_settings = termios.tcgetattr(fd)
|
|
3783
|
-
try:
|
|
3784
|
-
tty.setraw(sys.stdin.fileno())
|
|
3785
|
-
ch = sys.stdin.read(1)
|
|
3786
|
-
if ch == '\x1b': # Escape sequence
|
|
3787
|
-
ch2 = sys.stdin.read(1)
|
|
3788
|
-
if ch2 == '[':
|
|
3789
|
-
ch3 = sys.stdin.read(1)
|
|
3790
|
-
if ch3 == 'A':
|
|
3791
|
-
return 'UP'
|
|
3792
|
-
elif ch3 == 'B':
|
|
3793
|
-
return 'DOWN'
|
|
3794
|
-
elif ch == '\r' or ch == '\n':
|
|
3795
|
-
return 'ENTER'
|
|
3796
|
-
elif ch == '\x03': # Ctrl+C
|
|
3797
|
-
return 'CTRL_C'
|
|
3798
|
-
return ch
|
|
3799
|
-
finally:
|
|
3800
|
-
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
|
|
3801
|
-
|
|
3802
|
-
def display_menu():
|
|
3803
|
-
"""Display the GPU selection menu with current selection highlighted."""
|
|
3804
|
-
print("\nš Available GPU Options:")
|
|
3805
|
-
print("āāāāāāāāāāāāāāāā¬āāāāāāāāāā")
|
|
3806
|
-
print("ā GPU Type ā VRAM ā")
|
|
3807
|
-
print("āāāāāāāāāāāāāāāā¼āāāāāāāāāā¤")
|
|
3808
|
-
|
|
3809
|
-
for i, gpu_type in enumerate(options):
|
|
3810
|
-
specs = gpu_specs[gpu_type]
|
|
3811
|
-
# Calculate proper spacing for alignment
|
|
3812
|
-
number_part = f"{i+1}."
|
|
3813
|
-
if i == selected_index:
|
|
3814
|
-
prefix = "> "
|
|
3815
|
-
suffix = " ā"
|
|
3816
|
-
else:
|
|
3817
|
-
prefix = " "
|
|
3818
|
-
suffix = ""
|
|
3819
|
-
|
|
3820
|
-
# Ensure consistent width for GPU type column
|
|
3821
|
-
gpu_display = f"{prefix}{number_part} {gpu_type}"
|
|
3822
|
-
gpu_padded = f"{gpu_display:<12}" # Fixed width for GPU column
|
|
3823
|
-
|
|
3824
|
-
print(f"ā {gpu_padded} ā {specs['memory']:<7} ā{suffix}")
|
|
3825
|
-
|
|
3826
|
-
print("āāāāāāāāāāāāāāāā“āāāāāāāāāā")
|
|
3827
|
-
print("Use ā/ā arrows to select, Enter to confirm, Ctrl+C to cancel")
|
|
3828
|
-
|
|
3829
|
-
# Clear screen and show initial menu
|
|
3830
|
-
print("\033[2J\033[H", end="") # Clear screen and move cursor to top
|
|
3831
|
-
display_menu()
|
|
3832
|
-
|
|
3833
|
-
while True:
|
|
3834
|
-
try:
|
|
3835
|
-
key = get_key()
|
|
3836
|
-
|
|
3837
|
-
if key == 'UP':
|
|
3838
|
-
selected_index = (selected_index - 1) % len(options)
|
|
3839
|
-
print("\033[2J\033[H", end="") # Clear screen
|
|
3840
|
-
display_menu()
|
|
3841
|
-
elif key == 'DOWN':
|
|
3842
|
-
selected_index = (selected_index + 1) % len(options)
|
|
3843
|
-
print("\033[2J\033[H", end="") # Clear screen
|
|
3844
|
-
display_menu()
|
|
3845
|
-
elif key == 'ENTER':
|
|
3846
|
-
selected_gpu = options[selected_index]
|
|
3847
|
-
print(f"\nā
Selected GPU: {selected_gpu}")
|
|
3848
|
-
return selected_gpu
|
|
3849
|
-
elif key == 'CTRL_C':
|
|
3850
|
-
print("\nš Selection cancelled.")
|
|
3851
|
-
sys.exit(1)
|
|
3852
|
-
|
|
3853
|
-
except KeyboardInterrupt:
|
|
3854
|
-
print("\nš Selection cancelled.")
|
|
3855
|
-
sys.exit(1)
|
|
3856
|
-
except Exception as e:
|
|
3857
|
-
print(f"\nā Error with interactive menu: {e}")
|
|
3858
|
-
print("š Falling back to simple text input...")
|
|
3859
|
-
# Fall back to simple input method
|
|
3860
|
-
try:
|
|
3861
|
-
print("\nš Available GPU Options:")
|
|
3862
|
-
for i, gpu_type in enumerate(options, 1):
|
|
3863
|
-
specs = gpu_specs[gpu_type]
|
|
3864
|
-
print(f" {i}. {gpu_type} ({specs['memory']})")
|
|
3865
|
-
print(f" Default: A10G")
|
|
3866
|
-
|
|
3867
|
-
choice = input("\nš Select GPU type (number or name, default is A10G): ").strip()
|
|
3868
|
-
if not choice:
|
|
3869
|
-
print("ā
Using default GPU: A10G")
|
|
3870
|
-
return "A10G"
|
|
3871
|
-
if choice.isdigit():
|
|
3872
|
-
index = int(choice) - 1
|
|
3873
|
-
if 0 <= index < len(options):
|
|
3874
|
-
selected = options[index]
|
|
3875
|
-
print(f"ā
Selected GPU: {selected}")
|
|
3876
|
-
return selected
|
|
3877
|
-
else:
|
|
3878
|
-
print(f"ā ļø Invalid number. Using default: A10G")
|
|
3879
|
-
return "A10G"
|
|
3880
|
-
elif choice in options:
|
|
3881
|
-
print(f"ā
Selected GPU: {choice}")
|
|
3882
|
-
return choice
|
|
3883
|
-
else:
|
|
3884
|
-
print(f"ā ļø Invalid choice '{choice}'. Using default: A10G")
|
|
3885
|
-
return "A10G"
|
|
3886
|
-
except KeyboardInterrupt:
|
|
3887
|
-
print("\nš Selection cancelled.")
|
|
3888
|
-
sys.exit(1)
|
|
3889
|
-
except Exception as fallback_error:
|
|
3890
|
-
print(f"ā Error in fallback input: {fallback_error}")
|
|
3891
|
-
print("ā
Using default GPU: A10G")
|
|
3892
|
-
return "A10G"
|
|
3713
|
+
|
|
3893
3714
|
|
|
3894
3715
|
|
|
3895
3716
|
|
|
@@ -4237,7 +4058,21 @@ if __name__ == "__main__":
|
|
|
4237
4058
|
|
|
4238
4059
|
# If --list-gpus is specified, just show GPU options and exit
|
|
4239
4060
|
if args.list_gpus:
|
|
4240
|
-
|
|
4061
|
+
print("\nš Available GPU Options:")
|
|
4062
|
+
print("āāāāāāāāāāāāāāāā¬āāāāāāāāāā")
|
|
4063
|
+
print("ā GPU Type ā VRAM ā")
|
|
4064
|
+
print("āāāāāāāāāāāāāāāā¼āāāāāāāāāā¤")
|
|
4065
|
+
print("ā 1. T4 ā 16GB ā")
|
|
4066
|
+
print("ā 2. L4 ā 24GB ā")
|
|
4067
|
+
print("ā 3. A10G ā 24GB ā")
|
|
4068
|
+
print("ā 4. A100-40 ā 40GB ā")
|
|
4069
|
+
print("ā 5. A100-80 ā 80GB ā")
|
|
4070
|
+
print("ā 6. L40S ā 48GB ā")
|
|
4071
|
+
print("ā 7. H100 ā 80GB ā")
|
|
4072
|
+
print("ā 8. H200 ā 141GB ā")
|
|
4073
|
+
print("ā 9. B200 ā 141GB ā")
|
|
4074
|
+
print("āāāāāāāāāāāāāāāā“āāāāāāāāāā")
|
|
4075
|
+
print("Use --gpu <type> to specify a GPU type")
|
|
4241
4076
|
sys.exit(0)
|
|
4242
4077
|
|
|
4243
4078
|
# If no arguments or only --show-examples is provided, show usage examples
|
|
@@ -4297,8 +4132,8 @@ if __name__ == "__main__":
|
|
|
4297
4132
|
print(f"ā
Using specified GPU: {gpu_type}")
|
|
4298
4133
|
else:
|
|
4299
4134
|
print("\nš No GPU type specified with --gpu flag.")
|
|
4300
|
-
print("š
|
|
4301
|
-
gpu_type =
|
|
4135
|
+
print("š Using default GPU type: A10G")
|
|
4136
|
+
gpu_type = "A10G"
|
|
4302
4137
|
args.gpu = gpu_type
|
|
4303
4138
|
|
|
4304
4139
|
# Display configuration after GPU selection
|
|
@@ -2016,43 +2016,6 @@ Provide fixes for all {len(failed_commands)} failed commands:"""
|
|
|
2016
2016
|
print(f"ā Error during batch debugging: {e}")
|
|
2017
2017
|
return []
|
|
2018
2018
|
|
|
2019
|
-
def prompt_for_hf_token():
|
|
2020
|
-
"""Prompt user for Hugging Face token when needed"""
|
|
2021
|
-
# Try to use credentials manager first
|
|
2022
|
-
try:
|
|
2023
|
-
from credentials_manager import CredentialsManager
|
|
2024
|
-
credentials_manager = CredentialsManager()
|
|
2025
|
-
token = credentials_manager.get_huggingface_token()
|
|
2026
|
-
if token:
|
|
2027
|
-
return token
|
|
2028
|
-
except ImportError:
|
|
2029
|
-
# Fall back to direct input if credentials_manager is not available
|
|
2030
|
-
pass
|
|
2031
|
-
|
|
2032
|
-
# Traditional direct input method as fallback
|
|
2033
|
-
print("\n" + "="*60)
|
|
2034
|
-
print("š HUGGING FACE TOKEN REQUIRED")
|
|
2035
|
-
print("="*60)
|
|
2036
|
-
print("The training script requires a valid Hugging Face token.")
|
|
2037
|
-
print("You can get your token from: https://huggingface.co/settings/tokens")
|
|
2038
|
-
print("š Please paste your Hugging Face token below:")
|
|
2039
|
-
print(" (Your input will be hidden for security)")
|
|
2040
|
-
print("-" * 60)
|
|
2041
|
-
|
|
2042
|
-
try:
|
|
2043
|
-
token = getpass.getpass("HF Token: ").strip()
|
|
2044
|
-
if not token:
|
|
2045
|
-
print("ā No token provided.")
|
|
2046
|
-
return None
|
|
2047
|
-
print("ā
Token received successfully!")
|
|
2048
|
-
return token
|
|
2049
|
-
except KeyboardInterrupt:
|
|
2050
|
-
print("\nā Token input cancelled by user.")
|
|
2051
|
-
return None
|
|
2052
|
-
except Exception as e:
|
|
2053
|
-
print(f"ā Error getting token: {e}")
|
|
2054
|
-
return None
|
|
2055
|
-
|
|
2056
2019
|
def generate_random_password(length=16):
|
|
2057
2020
|
"""Generate a random password for SSH access"""
|
|
2058
2021
|
alphabet = string.ascii_letters + string.digits + "!@#$%^&*"
|
|
@@ -2067,9 +2030,10 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
|
2067
2030
|
|
|
2068
2031
|
# Use interactive mode if specified
|
|
2069
2032
|
if interactive:
|
|
2070
|
-
# If GPU type is not specified,
|
|
2033
|
+
# If GPU type is not specified, use default
|
|
2071
2034
|
if not gpu_type:
|
|
2072
|
-
gpu_type =
|
|
2035
|
+
gpu_type = "A10G"
|
|
2036
|
+
print(f"ā
Using default GPU type: {gpu_type}")
|
|
2073
2037
|
else:
|
|
2074
2038
|
print(f"ā
Using provided GPU type: {gpu_type}")
|
|
2075
2039
|
|
|
@@ -3746,150 +3710,7 @@ def get_setup_commands_from_gitingest(repo_url):
|
|
|
3746
3710
|
print("ā All API endpoints failed")
|
|
3747
3711
|
return generate_fallback_commands(gitingest_data)
|
|
3748
3712
|
|
|
3749
|
-
|
|
3750
|
-
"""
|
|
3751
|
-
Prompt the user to select a GPU type from available options using arrow keys.
|
|
3752
|
-
Returns the selected GPU type.
|
|
3753
|
-
"""
|
|
3754
|
-
import sys
|
|
3755
|
-
import tty
|
|
3756
|
-
import termios
|
|
3757
|
-
|
|
3758
|
-
print("\nš§ GPU Selection Required")
|
|
3759
|
-
print("No GPU type was specified with --gpu flag.")
|
|
3760
|
-
print("Please select a GPU type for your container:")
|
|
3761
|
-
|
|
3762
|
-
# Define available GPU types and their specifications
|
|
3763
|
-
gpu_specs = {
|
|
3764
|
-
'T4': {'gpu': 'T4', 'memory': '16GB'},
|
|
3765
|
-
'L4': {'gpu': 'L4', 'memory': '24GB'},
|
|
3766
|
-
'A10G': {'gpu': 'A10G', 'memory': '24GB'},
|
|
3767
|
-
'A100-40': {'gpu': 'A100-40GB', 'memory': '40GB'},
|
|
3768
|
-
'A100-80': {'gpu': 'A100-80GB', 'memory': '80GB'},
|
|
3769
|
-
'L40S': {'gpu': 'L40S', 'memory': '48GB'},
|
|
3770
|
-
'H100': {'gpu': 'H100', 'memory': '80GB'},
|
|
3771
|
-
'H200': {'gpu': 'H200', 'memory': '141GB'},
|
|
3772
|
-
'B200': {'gpu': 'B200', 'memory': '141GB'}
|
|
3773
|
-
}
|
|
3774
|
-
|
|
3775
|
-
# Create a list of options
|
|
3776
|
-
options = list(gpu_specs.keys())
|
|
3777
|
-
selected_index = 2 # Default to A10G (index 2)
|
|
3778
|
-
|
|
3779
|
-
def get_key():
|
|
3780
|
-
"""Get a single keypress from the user."""
|
|
3781
|
-
fd = sys.stdin.fileno()
|
|
3782
|
-
old_settings = termios.tcgetattr(fd)
|
|
3783
|
-
try:
|
|
3784
|
-
tty.setraw(sys.stdin.fileno())
|
|
3785
|
-
ch = sys.stdin.read(1)
|
|
3786
|
-
if ch == '\x1b': # Escape sequence
|
|
3787
|
-
ch2 = sys.stdin.read(1)
|
|
3788
|
-
if ch2 == '[':
|
|
3789
|
-
ch3 = sys.stdin.read(1)
|
|
3790
|
-
if ch3 == 'A':
|
|
3791
|
-
return 'UP'
|
|
3792
|
-
elif ch3 == 'B':
|
|
3793
|
-
return 'DOWN'
|
|
3794
|
-
elif ch == '\r' or ch == '\n':
|
|
3795
|
-
return 'ENTER'
|
|
3796
|
-
elif ch == '\x03': # Ctrl+C
|
|
3797
|
-
return 'CTRL_C'
|
|
3798
|
-
return ch
|
|
3799
|
-
finally:
|
|
3800
|
-
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
|
|
3801
|
-
|
|
3802
|
-
def display_menu():
|
|
3803
|
-
"""Display the GPU selection menu with current selection highlighted."""
|
|
3804
|
-
print("\nš Available GPU Options:")
|
|
3805
|
-
print("āāāāāāāāāāāāāāāā¬āāāāāāāāāā")
|
|
3806
|
-
print("ā GPU Type ā VRAM ā")
|
|
3807
|
-
print("āāāāāāāāāāāāāāāā¼āāāāāāāāāā¤")
|
|
3808
|
-
|
|
3809
|
-
for i, gpu_type in enumerate(options):
|
|
3810
|
-
specs = gpu_specs[gpu_type]
|
|
3811
|
-
# Calculate proper spacing for alignment
|
|
3812
|
-
number_part = f"{i+1}."
|
|
3813
|
-
if i == selected_index:
|
|
3814
|
-
prefix = "> "
|
|
3815
|
-
suffix = " ā"
|
|
3816
|
-
else:
|
|
3817
|
-
prefix = " "
|
|
3818
|
-
suffix = ""
|
|
3819
|
-
|
|
3820
|
-
# Ensure consistent width for GPU type column
|
|
3821
|
-
gpu_display = f"{prefix}{number_part} {gpu_type}"
|
|
3822
|
-
gpu_padded = f"{gpu_display:<12}" # Fixed width for GPU column
|
|
3823
|
-
|
|
3824
|
-
print(f"ā {gpu_padded} ā {specs['memory']:<7} ā{suffix}")
|
|
3825
|
-
|
|
3826
|
-
print("āāāāāāāāāāāāāāāā“āāāāāāāāāā")
|
|
3827
|
-
print("Use ā/ā arrows to select, Enter to confirm, Ctrl+C to cancel")
|
|
3828
|
-
|
|
3829
|
-
# Clear screen and show initial menu
|
|
3830
|
-
print("\033[2J\033[H", end="") # Clear screen and move cursor to top
|
|
3831
|
-
display_menu()
|
|
3832
|
-
|
|
3833
|
-
while True:
|
|
3834
|
-
try:
|
|
3835
|
-
key = get_key()
|
|
3836
|
-
|
|
3837
|
-
if key == 'UP':
|
|
3838
|
-
selected_index = (selected_index - 1) % len(options)
|
|
3839
|
-
print("\033[2J\033[H", end="") # Clear screen
|
|
3840
|
-
display_menu()
|
|
3841
|
-
elif key == 'DOWN':
|
|
3842
|
-
selected_index = (selected_index + 1) % len(options)
|
|
3843
|
-
print("\033[2J\033[H", end="") # Clear screen
|
|
3844
|
-
display_menu()
|
|
3845
|
-
elif key == 'ENTER':
|
|
3846
|
-
selected_gpu = options[selected_index]
|
|
3847
|
-
print(f"\nā
Selected GPU: {selected_gpu}")
|
|
3848
|
-
return selected_gpu
|
|
3849
|
-
elif key == 'CTRL_C':
|
|
3850
|
-
print("\nš Selection cancelled.")
|
|
3851
|
-
sys.exit(1)
|
|
3852
|
-
|
|
3853
|
-
except KeyboardInterrupt:
|
|
3854
|
-
print("\nš Selection cancelled.")
|
|
3855
|
-
sys.exit(1)
|
|
3856
|
-
except Exception as e:
|
|
3857
|
-
print(f"\nā Error with interactive menu: {e}")
|
|
3858
|
-
print("š Falling back to simple text input...")
|
|
3859
|
-
# Fall back to simple input method
|
|
3860
|
-
try:
|
|
3861
|
-
print("\nš Available GPU Options:")
|
|
3862
|
-
for i, gpu_type in enumerate(options, 1):
|
|
3863
|
-
specs = gpu_specs[gpu_type]
|
|
3864
|
-
print(f" {i}. {gpu_type} ({specs['memory']})")
|
|
3865
|
-
print(f" Default: A10G")
|
|
3866
|
-
|
|
3867
|
-
choice = input("\nš Select GPU type (number or name, default is A10G): ").strip()
|
|
3868
|
-
if not choice:
|
|
3869
|
-
print("ā
Using default GPU: A10G")
|
|
3870
|
-
return "A10G"
|
|
3871
|
-
if choice.isdigit():
|
|
3872
|
-
index = int(choice) - 1
|
|
3873
|
-
if 0 <= index < len(options):
|
|
3874
|
-
selected = options[index]
|
|
3875
|
-
print(f"ā
Selected GPU: {selected}")
|
|
3876
|
-
return selected
|
|
3877
|
-
else:
|
|
3878
|
-
print(f"ā ļø Invalid number. Using default: A10G")
|
|
3879
|
-
return "A10G"
|
|
3880
|
-
elif choice in options:
|
|
3881
|
-
print(f"ā
Selected GPU: {choice}")
|
|
3882
|
-
return choice
|
|
3883
|
-
else:
|
|
3884
|
-
print(f"ā ļø Invalid choice '{choice}'. Using default: A10G")
|
|
3885
|
-
return "A10G"
|
|
3886
|
-
except KeyboardInterrupt:
|
|
3887
|
-
print("\nš Selection cancelled.")
|
|
3888
|
-
sys.exit(1)
|
|
3889
|
-
except Exception as fallback_error:
|
|
3890
|
-
print(f"ā Error in fallback input: {fallback_error}")
|
|
3891
|
-
print("ā
Using default GPU: A10G")
|
|
3892
|
-
return "A10G"
|
|
3713
|
+
|
|
3893
3714
|
|
|
3894
3715
|
|
|
3895
3716
|
|
|
@@ -4237,7 +4058,21 @@ if __name__ == "__main__":
|
|
|
4237
4058
|
|
|
4238
4059
|
# If --list-gpus is specified, just show GPU options and exit
|
|
4239
4060
|
if args.list_gpus:
|
|
4240
|
-
|
|
4061
|
+
print("\nš Available GPU Options:")
|
|
4062
|
+
print("āāāāāāāāāāāāāāāā¬āāāāāāāāāā")
|
|
4063
|
+
print("ā GPU Type ā VRAM ā")
|
|
4064
|
+
print("āāāāāāāāāāāāāāāā¼āāāāāāāāāā¤")
|
|
4065
|
+
print("ā 1. T4 ā 16GB ā")
|
|
4066
|
+
print("ā 2. L4 ā 24GB ā")
|
|
4067
|
+
print("ā 3. A10G ā 24GB ā")
|
|
4068
|
+
print("ā 4. A100-40 ā 40GB ā")
|
|
4069
|
+
print("ā 5. A100-80 ā 80GB ā")
|
|
4070
|
+
print("ā 6. L40S ā 48GB ā")
|
|
4071
|
+
print("ā 7. H100 ā 80GB ā")
|
|
4072
|
+
print("ā 8. H200 ā 141GB ā")
|
|
4073
|
+
print("ā 9. B200 ā 141GB ā")
|
|
4074
|
+
print("āāāāāāāāāāāāāāāā“āāāāāāāāāā")
|
|
4075
|
+
print("Use --gpu <type> to specify a GPU type")
|
|
4241
4076
|
sys.exit(0)
|
|
4242
4077
|
|
|
4243
4078
|
# If no arguments or only --show-examples is provided, show usage examples
|
|
@@ -4297,8 +4132,8 @@ if __name__ == "__main__":
|
|
|
4297
4132
|
print(f"ā
Using specified GPU: {gpu_type}")
|
|
4298
4133
|
else:
|
|
4299
4134
|
print("\nš No GPU type specified with --gpu flag.")
|
|
4300
|
-
print("š
|
|
4301
|
-
gpu_type =
|
|
4135
|
+
print("š Using default GPU type: A10G")
|
|
4136
|
+
gpu_type = "A10G"
|
|
4302
4137
|
args.gpu = gpu_type
|
|
4303
4138
|
|
|
4304
4139
|
# Display configuration after GPU selection
|