Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStream
|
|
58 |
# ----------------------------------------------------------------------
|
59 |
# 1. Setup Model & Tokenizer (Using 8-bit Quantization from Script 2)
|
60 |
# ----------------------------------------------------------------------
|
61 |
-
model_name = 'Tesslate/UIGEN-T3-4B' # Or use Tesslate/UIGEN-T2-7B-3600 if preferred
|
62 |
use_thread = True # For streaming UI updates
|
63 |
|
64 |
# Determine optimal attention implementation
|
@@ -135,11 +135,11 @@ logger = logging.getLogger(__name__)
|
|
135 |
# 2. Generation Parameter Setup (Values can be adjusted)
|
136 |
# ----------------------------------------------------------------------
|
137 |
# Using similar defaults as Script 2, but can be tuned
|
138 |
-
MAX_NEW_TOKENS =
|
139 |
-
TEMPERATURE = 0.
|
140 |
-
TOP_P = 0.
|
141 |
-
TOP_K =
|
142 |
-
REPETITION_PENALTY = 1.
|
143 |
|
144 |
# Note: initialize_gen_kwargs function is removed as params are used directly now
|
145 |
|
|
|
58 |
# ----------------------------------------------------------------------
|
59 |
# 1. Setup Model & Tokenizer (Using 8-bit Quantization from Script 2)
|
60 |
# ----------------------------------------------------------------------
|
61 |
+
model_name = 'Tesslate/UIGEN-T3-4B-Preview' # Or use Tesslate/UIGEN-T2-7B-3600 if preferred
|
62 |
use_thread = True # For streaming UI updates
|
63 |
|
64 |
# Determine optimal attention implementation
|
|
|
135 |
# 2. Generation Parameter Setup (Values can be adjusted)
|
136 |
# ----------------------------------------------------------------------
|
137 |
# Using similar defaults as Script 2, but can be tuned
|
138 |
+
MAX_NEW_TOKENS = 20000 # Adjusted back, but can be increased if needed
|
139 |
+
TEMPERATURE = 0.6
|
140 |
+
TOP_P = 0.95 # Slightly lower than Script 2 default
|
141 |
+
TOP_K = 20 # Added based on Script 2 defaults
|
142 |
+
REPETITION_PENALTY = 1.0 # Based on Script 2 defaults
|
143 |
|
144 |
# Note: initialize_gen_kwargs function is removed as params are used directly now
|
145 |
|