-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.py
executable file
·88 lines (71 loc) · 1.99 KB
/
header.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python3
from os import system
def welcome():
"""
This function displays a welcome message
and waits for the user to press Enter to start.
"""
system("clear")
print("\nHyppochoipus")
print("By Melvin Redondo--Tanis\n")
print("Contibutors:")
print(" - Remi Marçais")
print("")
print("To exit press Ctrl+C")
input("Press Enter to start...")
system("clear")
def settings():
"""
This function displays the settings menu
and waits for the user to select a model, language, and number of students.
Returns:
tuple: The selected model, language, and number of students
"""
models = [
"tiny.en",
"tiny",
"base.en",
"base",
"small.en",
"small",
"medium.en",
"medium",
"large-v1",
"large-v2",
"large-v3",
"large",
"distil-large-v2",
"distil-medium.en",
"distil-small.en",
"distil-large-v3"
]
languages = [
"en",
"fr"
]
for i, model in enumerate(models, start=0):
print("[{}] {}".format(i, model))
try:
model_number = int(input("Select a model [number]: "))
except ValueError:
print("Invalid input. Please enter a valid number.")
return
for i, language in enumerate(languages, start=0):
print("[{}] {}".format(i, language))
try:
language_number = int(input("Select a language [number]: "))
except ValueError:
print("Invalid input. Please enter a valid number.")
return
try:
students_number = int(input(
"Select the number of students [number]: "
))
except ValueError:
print("Invalid input. Please enter a valid number.")
return
system("clear")
return models[model_number], languages[language_number], students_number
if __name__ == "__main__":
welcome()
settings()