Skip to content

Commit

Permalink
feat: Fix mistral textspeeds (#439)
Browse files Browse the repository at this point in the history
* feat: Prevent mistral models being considered too fast

* feat: news
  • Loading branch information
db0 authored Aug 7, 2024
1 parent abff706 commit 2d078b1
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 11 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

# 4.30.0
# 4.40.1

* Prevents mistral models from being considered suspiciously fast.

# 4.40.0

* Adds the `active_generations` privileged key on user info providing a list of all non-expired gens the user has active.

Expand Down
5 changes: 4 additions & 1 deletion horde/classes/kobold/processing_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,8 @@ def record(self, things_per_sec, kudos):
if param_multiplier >= params_count:
unreasonable_speed = max_speed_per_multiplier[params_count]
break
# This handles the 8x7 and 8x22 models which are generally faster than their size implies.
if "8x" in self.model:
unreasonable_speed = unreasonable_speed * 3
if things_per_sec > unreasonable_speed:
self.worker.report_suspicion(reason=Suspicions.UNREASONABLY_FAST, formats=[things_per_sec])
self.worker.report_suspicion(reason=Suspicions.UNREASONABLY_FAST, formats=[f"{things_per_sec} > {unreasonable_speed}"])
2 changes: 1 addition & 1 deletion horde/consts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HORDE_VERSION = "4.40.0"
HORDE_VERSION = "4.40.1"

WHITELISTED_SERVICE_IPS = {
"212.227.227.178", # Turing Bot
Expand Down
27 changes: 23 additions & 4 deletions horde/data/news.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
[
{
"date_published": "2024-05-20",
"date_published": "2024-08-07",
"newspiece": "ArtBot is now an official component of Haidra! You can check the official version at [https://artbot.site](https://artbot.site which is running the latest version of it with a ton of improvements. All kudos to [Rockbandit](https://mastodon.world/@davely)",
"tags": [
"nlnet",
"rockbandit"
],
"importance": "Information",
"more_info_urls": [
"https://artbot.site",
"https://mastodon.world/@davely"
],
"title": "Official Artbot"
},
{
"date_published": "2024-07-15",
"newspiece": "You can now use the [SD Layer Diffuse tech](https://github.com/layerdiffusion/sd-forge-layerdiffuse) to generate transparent images directly with the AI horde (without the use of a post-processor). To use this functionality, simply pass `transparent: true` in your payloads params. This feature is not supported on Img2Img however.",
"tags": [
"db0",
"nlnet",
"text2img"
],
"importance": "Information",
"more_info_urls": [],
"title": "Generate QR Codes"
"more_info_urls": [
"https://dbzer0.com/blog/transparent-generations/",
"https://github.com/layerdiffusion/sd-forge-layerdiffuse"
],
"title": "Images with Transparency"
},
{
"date_published": "2024-05-20",
Expand All @@ -20,7 +37,9 @@
"text2img"
],
"importance": "Information",
"more_info_urls": [],
"more_info_urls": [
"https://dbzer0.com/blog/embedded-qr-codes-via-the-ai-horde/"
],
"title": "Generate QR Codes"
},
{
Expand Down
12 changes: 8 additions & 4 deletions horde/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,21 @@ def __init__(self, amount, decimals=1):
self.prefix = "kilo"
self.char = "K"
elif self.digits < 10:
self.amount = round(amount / 1000000, self.decimals)
self.amount = round(amount / 1_000_000, self.decimals)
self.prefix = "mega"
self.char = "M"
elif self.digits < 13:
self.amount = round(amount / 1000000000, self.decimals)
self.amount = round(amount / 1_000_000_000, self.decimals)
self.prefix = "giga"
self.char = "G"
else:
self.amount = round(amount / 1000000000000, self.decimals)
elif self.digits < 16:
self.amount = round(amount / 1_000_000_000_000, self.decimals)
self.prefix = "tera"
self.char = "T"
else:
self.amount = round(amount / 1_000_000_000_000_000, self.decimals)
self.prefix = "peta"
self.char = "P"


def get_db_uuid():
Expand Down

0 comments on commit 2d078b1

Please sign in to comment.