Skip to content

Commit 4be9433

Browse files
authored
Merge pull request #106 from ovchynnikov/dev
increase LLM response length
2 parents 56ddc20 + 3211f41 commit 4be9433

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/github-actions-push-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Build and push Docker image
4747
id: push
48-
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
48+
uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0
4949
with:
5050
context: .
5151
file: ./Dockerfile

src/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
# Reply with user data for Healthcheck
3535
send_user_info_with_healthcheck = os.getenv("SEND_USER_INFO_WITH_HEALTHCHECK", "False").lower() == "true"
3636
USE_LLM = os.getenv("USE_LLM", "False").lower() == "true"
37-
LLM_MODEL = os.getenv("LLM_MODEL", "gemma3:4b")
38-
LLM_API_ADDR = os.getenv("LLM_API_ADDR", "http://localhost:11434")
37+
# LLM_MODEL = os.getenv("LLM_MODEL", "gemma3:4b")
38+
LLM_API_ADDR = os.getenv("LLM_API_ADDR", "http://localhost:11435")
3939
TELEGRAM_WRITE_TIMEOUT = 8000
4040
TELEGRAM_READ_TIMEOUT = 8000
4141

@@ -461,14 +461,14 @@ async def respond_with_llm_message(update):
461461
f"{LLM_API_ADDR}/completion",
462462
json={
463463
"prompt": prompt,
464-
"n_predict": 200,
464+
"n_predict": 1024,
465465
"temperature": 0.7,
466466
"stop": ["</s>", "User:", "Assistant:"],
467467
},
468468
) as response:
469469
if response.status == 200:
470470
result = await response.json()
471-
bot_response = result.get("content", "Sorry, I couldn't generate a response.")
471+
bot_response = result.get("content", "Sorry, I couldn't generate a response.").strip()
472472
else:
473473
bot_response = "Sorry, I encountered an error while processing your request."
474474

0 commit comments

Comments
 (0)