Add ExLlama support (#2444)

This commit is contained in:
oobabooga 2023-06-16 20:35:38 -03:00 committed by GitHub
parent dea43685b0
commit 9f40032d32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 156 additions and 47 deletions

View file

@ -55,11 +55,12 @@ class Iteratorize:
Adapted from: https://stackoverflow.com/a/9969000
"""
def __init__(self, func, kwargs=None, callback=None):
def __init__(self, func, args=None, kwargs=None, callback=None):
self.mfunc = func
self.c_callback = callback
self.q = Queue()
self.sentinel = object()
self.args = args or []
self.kwargs = kwargs or {}
self.stop_now = False
@ -70,7 +71,7 @@ class Iteratorize:
def gentask():
try:
ret = self.mfunc(callback=_callback, **self.kwargs)
ret = self.mfunc(callback=_callback, *args, **self.kwargs)
except ValueError:
pass
except: