Skip to content

Commit

Permalink
use default factories for dataclass attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Franz Maria Heuchel authored and rlouf committed Sep 17, 2024
1 parent a3fe2b8 commit 2464eca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions prompts/tokens.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Dict, Optional


Expand All @@ -10,10 +10,10 @@ class Limits:

@dataclass
class Special:
sequence: Limits = Limits("", "")
user: Limits = Limits("", "")
assistant: Limits = Limits("", "")
system: Limits = Limits("", "")
sequence: Limits = field(default_factory=lambda: Limits())
user: Limits = field(default_factory=lambda: Limits())
assistant: Limits = field(default_factory=lambda: Limits())
system: Limits = field(default_factory=lambda: Limits())


SPECIAL_TOKENS: Dict[Optional[str], Special] = {
Expand Down

0 comments on commit 2464eca

Please sign in to comment.