[FE] Fix default value for guidance scale
This commit is contained in:
parent
7e84144432
commit
4a9d60e00b
|
|
@ -109,6 +109,7 @@ def update_quota(c, apikey, quota):
|
||||||
result = c.fetchone()
|
result = c.fetchone()
|
||||||
if result is not None:
|
if result is not None:
|
||||||
c.execute("UPDATE users SET quota=? WHERE apikey=?", (quota, apikey))
|
c.execute("UPDATE users SET quota=? WHERE apikey=?", (quota, apikey))
|
||||||
|
raise ValueError(f"{apikey} does not exist")
|
||||||
|
|
||||||
|
|
||||||
def update_username(c, apikey, username):
|
def update_username(c, apikey, username):
|
||||||
|
|
@ -212,6 +213,8 @@ def manage(args):
|
||||||
)
|
)
|
||||||
elif args.table_action == "show":
|
elif args.table_action == "show":
|
||||||
modify_table(c, args.table_name, args.table_action)
|
modify_table(c, args.table_name, args.table_action)
|
||||||
|
elif args.update_type == "quota":
|
||||||
|
update_quota(c, args.apikey, args.quota)
|
||||||
elif args.action == "delete":
|
elif args.action == "delete":
|
||||||
if args.delete_type == "user":
|
if args.delete_type == "user":
|
||||||
delete_user(c, args.username)
|
delete_user(c, args.username)
|
||||||
|
|
@ -248,6 +251,11 @@ def main():
|
||||||
update_user_parser.add_argument("username")
|
update_user_parser.add_argument("username")
|
||||||
update_user_parser.add_argument("apikey")
|
update_user_parser.add_argument("apikey")
|
||||||
|
|
||||||
|
# Sub-parser for updating a quota
|
||||||
|
update_quota_parser = update_subparsers.add_parser("quota")
|
||||||
|
update_quota_parser.add_argument("apikey")
|
||||||
|
update_quota_parser.add_argument("quota")
|
||||||
|
|
||||||
# Sub-parser for updating a table
|
# Sub-parser for updating a table
|
||||||
update_table_parser = update_subparsers.add_parser("table")
|
update_table_parser = update_subparsers.add_parser("table")
|
||||||
update_table_subparsers = update_table_parser.add_subparsers(
|
update_table_subparsers = update_table_parser.add_subparsers(
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,7 @@
|
||||||
}
|
}
|
||||||
var guidanceScaleVal = parseFloat($('#inputGuidanceScale').val())
|
var guidanceScaleVal = parseFloat($('#inputGuidanceScale').val())
|
||||||
if (isNaN(guidanceScaleVal)) {
|
if (isNaN(guidanceScaleVal)) {
|
||||||
guidanceScaleVal = 25.0;
|
guidanceScaleVal = 12.5;
|
||||||
}
|
}
|
||||||
var stepsVal = parseInt($('#inputSteps').val());
|
var stepsVal = parseInt($('#inputSteps').val());
|
||||||
if (isNaN(stepsVal)) {
|
if (isNaN(stepsVal)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue