Spaces:
Sleeping
Sleeping
⚡️ add min temp and epsilon_cutoff
Browse filesSigned-off-by: peter szemraj <peterszemraj@gmail.com>
app.py
CHANGED
@@ -4,7 +4,7 @@ from gradio.themes.utils import sizes
|
|
4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
5 |
|
6 |
import utils
|
7 |
-
from constants import END_OF_TEXT
|
8 |
|
9 |
# Load the tokenizer and model
|
10 |
tokenizer = AutoTokenizer.from_pretrained(
|
@@ -55,13 +55,13 @@ def run_inference(
|
|
55 |
outputs = model.generate(
|
56 |
**inputs,
|
57 |
do_sample=True,
|
58 |
-
|
59 |
max_new_tokens=max_new_tokens,
|
60 |
min_new_tokens=2,
|
61 |
no_repeat_ngram_size=6,
|
62 |
renormalize_logits=True,
|
63 |
repetition_penalty=repetition_penalty,
|
64 |
-
temperature=temperature,
|
65 |
top_p=top_p,
|
66 |
)
|
67 |
text = tokenizer.batch_decode(
|
|
|
4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
5 |
|
6 |
import utils
|
7 |
+
from constants import END_OF_TEXT, MIN_TEMPERATURE
|
8 |
|
9 |
# Load the tokenizer and model
|
10 |
tokenizer = AutoTokenizer.from_pretrained(
|
|
|
55 |
outputs = model.generate(
|
56 |
**inputs,
|
57 |
do_sample=True,
|
58 |
+
epsilon_cutoff=1e-3,
|
59 |
max_new_tokens=max_new_tokens,
|
60 |
min_new_tokens=2,
|
61 |
no_repeat_ngram_size=6,
|
62 |
renormalize_logits=True,
|
63 |
repetition_penalty=repetition_penalty,
|
64 |
+
temperature=max(temperature, MIN_TEMPERATURE)
|
65 |
top_p=top_p,
|
66 |
)
|
67 |
text = tokenizer.batch_decode(
|