mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-26 07:14:39 +01:00
Minor cleanup
This commit is contained in:
parent
843de8b8a8
commit
2e4232e02b
|
|
@ -34,7 +34,7 @@ class Iteratorize:
|
|||
|
||||
def gentask():
|
||||
try:
|
||||
ret = self.mfunc(callback=_callback, *args, **self.kwargs)
|
||||
ret = self.mfunc(callback=_callback, *self.args, **self.kwargs)
|
||||
except StopNowException:
|
||||
pass
|
||||
except Exception:
|
||||
|
|
|
|||
|
|
@ -81,14 +81,6 @@ def atoi(text):
|
|||
return int(text) if text.isdigit() else text.lower()
|
||||
|
||||
|
||||
# Replace multiple string pairs in a string
|
||||
def replace_all(text, dic):
|
||||
for i, j in dic.items():
|
||||
text = text.replace(i, j)
|
||||
|
||||
return text
|
||||
|
||||
|
||||
def natural_keys(text):
|
||||
return [atoi(c) for c in re.split(r'(\d+)', text)]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue