|
@@ -280,7 +280,6 @@ class OllamaTranslator(BaseTranslator):
|
|
|
|
|
|
|
|
def do_translate(self, text):
|
|
def do_translate(self, text):
|
|
|
maxlen = max(2000, len(text) * 5)
|
|
maxlen = max(2000, len(text) * 5)
|
|
|
- print("Prompt:", self.prompt(text, self.prompttext), "Maxlen:" , maxlen)
|
|
|
|
|
for model in self.model.split(";"):
|
|
for model in self.model.split(";"):
|
|
|
try:
|
|
try:
|
|
|
response = ""
|
|
response = ""
|
|
@@ -307,7 +306,6 @@ class OllamaTranslator(BaseTranslator):
|
|
|
else:
|
|
else:
|
|
|
response += chunk
|
|
response += chunk
|
|
|
if len(response) > maxlen:
|
|
if len(response) > maxlen:
|
|
|
- print(response)
|
|
|
|
|
raise Exception("Response too long")
|
|
raise Exception("Response too long")
|
|
|
return response.strip()
|
|
return response.strip()
|
|
|
except Exception as e:
|
|
except Exception as e:
|