Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0700476

Browse filesBrowse files
ddh0abetlen
andauthored
fix: Change repeat_penalty to 1.0 to match llama.cpp defaults (abetlen#1590)
* reapply changes after sync with main branch * change repeat_penalty to 1.0 to match llama.cpp defaults --------- Co-authored-by: Andrei <abetlen@gmail.com>
1 parent 797f54c commit 0700476
Copy full SHA for 0700476

File tree

Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed

‎llama_cpp/_internals.py

Copy file name to clipboardExpand all lines: llama_cpp/_internals.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ class _LlamaSamplingParams:
721721
typical_p: float = 1.00
722722
temp: float = 0.80
723723
penalty_last_n: int = 64
724-
penalty_repeat: float = 1.10
724+
penalty_repeat: float = 1.0
725725
penalty_freq: float = 0.00
726726
penalty_present: float = 0.00
727727
mirostat: int = 0

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ def sample(
658658
min_p: float = 0.05,
659659
typical_p: float = 1.0,
660660
temp: float = 0.80,
661-
repeat_penalty: float = 1.1,
661+
repeat_penalty: float = 1.0,
662662
frequency_penalty: float = 0.0,
663663
presence_penalty: float = 0.0,
664664
tfs_z: float = 1.0,
@@ -733,7 +733,7 @@ def generate(
733733
min_p: float = 0.05,
734734
typical_p: float = 1.0,
735735
temp: float = 0.80,
736-
repeat_penalty: float = 1.1,
736+
repeat_penalty: float = 1.0,
737737
reset: bool = True,
738738
frequency_penalty: float = 0.0,
739739
presence_penalty: float = 0.0,
@@ -751,7 +751,7 @@ def generate(
751751
Examples:
752752
>>> llama = Llama("models/ggml-7b.bin")
753753
>>> tokens = llama.tokenize(b"Hello, world!")
754-
>>> for token in llama.generate(tokens, top_k=40, top_p=0.95, temp=1.0, repeat_penalty=1.1):
754+
>>> for token in llama.generate(tokens, top_k=40, top_p=0.95, temp=1.0, repeat_penalty=1.0):
755755
... print(llama.detokenize([token]))
756756
757757
Args:
@@ -1020,7 +1020,7 @@ def _create_completion(
10201020
stop: Optional[Union[str, List[str]]] = [],
10211021
frequency_penalty: float = 0.0,
10221022
presence_penalty: float = 0.0,
1023-
repeat_penalty: float = 1.1,
1023+
repeat_penalty: float = 1.0,
10241024
top_k: int = 40,
10251025
stream: bool = False,
10261026
seed: Optional[int] = None,
@@ -1639,7 +1639,7 @@ def create_completion(
16391639
stop: Optional[Union[str, List[str]]] = [],
16401640
frequency_penalty: float = 0.0,
16411641
presence_penalty: float = 0.0,
1642-
repeat_penalty: float = 1.1,
1642+
repeat_penalty: float = 1.0,
16431643
top_k: int = 40,
16441644
stream: bool = False,
16451645
seed: Optional[int] = None,
@@ -1736,7 +1736,7 @@ def __call__(
17361736
stop: Optional[Union[str, List[str]]] = [],
17371737
frequency_penalty: float = 0.0,
17381738
presence_penalty: float = 0.0,
1739-
repeat_penalty: float = 1.1,
1739+
repeat_penalty: float = 1.0,
17401740
top_k: int = 40,
17411741
stream: bool = False,
17421742
seed: Optional[int] = None,
@@ -1833,7 +1833,7 @@ def create_chat_completion(
18331833
max_tokens: Optional[int] = None,
18341834
presence_penalty: float = 0.0,
18351835
frequency_penalty: float = 0.0,
1836-
repeat_penalty: float = 1.1,
1836+
repeat_penalty: float = 1.0,
18371837
tfs_z: float = 1.0,
18381838
mirostat_mode: int = 0,
18391839
mirostat_tau: float = 5.0,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.