Skip to content

increase LLM response length #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Build and push Docker image
id: push
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0
with:
context: .
file: ./Dockerfile
Expand Down
8 changes: 4 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
# Reply with user data for Healthcheck
send_user_info_with_healthcheck = os.getenv("SEND_USER_INFO_WITH_HEALTHCHECK", "False").lower() == "true"
USE_LLM = os.getenv("USE_LLM", "False").lower() == "true"
LLM_MODEL = os.getenv("LLM_MODEL", "gemma3:4b")
LLM_API_ADDR = os.getenv("LLM_API_ADDR", "http://localhost:11434")
# LLM_MODEL = os.getenv("LLM_MODEL", "gemma3:4b")
LLM_API_ADDR = os.getenv("LLM_API_ADDR", "http://localhost:11435")
TELEGRAM_WRITE_TIMEOUT = 8000
TELEGRAM_READ_TIMEOUT = 8000

Expand Down Expand Up @@ -461,14 +461,14 @@ async def respond_with_llm_message(update):
f"{LLM_API_ADDR}/completion",
json={
"prompt": prompt,
"n_predict": 200,
"n_predict": 1024,
"temperature": 0.7,
"stop": ["</s>", "User:", "Assistant:"],
},
) as response:
if response.status == 200:
result = await response.json()
bot_response = result.get("content", "Sorry, I couldn't generate a response.")
bot_response = result.get("content", "Sorry, I couldn't generate a response.").strip()
else:
bot_response = "Sorry, I encountered an error while processing your request."

Expand Down