Skip to content

Commit

Permalink
Timeout fixes, INT-conflict error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ruecat committed May 18, 2024
1 parent c9a156e commit f8672dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bot/func/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ollama_port = os.getenv("OLLAMA_PORT", "11434")
log_level_str = os.getenv("LOG_LEVEL", "INFO")
log_levels = list(logging._levelToName.values())
timeout = os.getenv("TIMEOUT")
timeout = os.getenv("TIMEOUT", "3000")
if log_level_str not in log_levels:
log_level = logging.DEBUG
else:
Expand All @@ -32,8 +32,8 @@ async def model_list():
else:
return []
async def generate(payload: dict, modelname: str, prompt: str):
timeout = ClientTimeout(total=timeout)
async with aiohttp.ClientSession(timeout=timeout) as session:
client_timeout = ClientTimeout(total=int(timeout))
async with aiohttp.ClientSession(timeout=client_timeout) as session:
url = f"http://{ollama_base_url}:{ollama_port}/api/chat"

try:
Expand Down
1 change: 0 additions & 1 deletion bot/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import traceback
import io
import base64

bot = Bot(token=token)
dp = Dispatcher()
start_kb = InlineKeyboardBuilder()
Expand Down

0 comments on commit f8672dd

Please sign in to comment.