mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-01-29 15:44:12 +00:00
bugfixed
This commit is contained in:
parent
3da776d605
commit
2a6f70bd87
@ -369,8 +369,8 @@ class ModelProcess:
|
||||
|
||||
def _callback(self, text, text_type=0):
|
||||
try:
|
||||
print(str(text),end="", flush=True)
|
||||
except:
|
||||
print(str(text), end="", flush=True)
|
||||
except Exception as ex:
|
||||
print(".")
|
||||
self.curent_text += text
|
||||
detected_anti_prompt = False
|
||||
@ -388,7 +388,7 @@ class ModelProcess:
|
||||
# Stream the generated text to the main process
|
||||
self.generation_queue.put((text,self.id, text_type))
|
||||
# if stop generation is detected then stop
|
||||
if self.completion_signal.is_set():
|
||||
if not self.completion_signal.is_set():
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
@ -82,12 +82,12 @@ class GPT4ALL(LLMBinding):
|
||||
verbose (bool, optional): If true, the code will spit many informations about the generation process. Defaults to False.
|
||||
"""
|
||||
try:
|
||||
response_tokens = []
|
||||
response_text = []
|
||||
def local_callback(token_id, response):
|
||||
decoded_token = response.decode('utf-8')
|
||||
response_tokens.append( decoded_token );
|
||||
decoded_word = response.decode('utf-8')
|
||||
response_text.append( decoded_word )
|
||||
if new_text_callback is not None:
|
||||
if not new_text_callback(''.join(response_tokens)):
|
||||
if not new_text_callback(decoded_word):
|
||||
return False
|
||||
|
||||
# Do whatever you want with decoded_token here.
|
||||
@ -106,7 +106,7 @@ class GPT4ALL(LLMBinding):
|
||||
)
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
return ''.join(response_tokens)
|
||||
return ''.join(response_text)
|
||||
|
||||
@staticmethod
|
||||
def get_available_models():
|
||||
|
3
docs/youtube/script_models.md
Normal file
3
docs/youtube/script_models.md
Normal file
@ -0,0 +1,3 @@
|
||||
Hi there, welcome to a snippet about bindings and models selection.
|
||||
|
||||
In this short video we will look at bindings and models
|
Loading…
x
Reference in New Issue
Block a user