Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -48,8 +48,8 @@ def generate_response(user_input, chat_history):
|
|
48 |
max_length=max_response_length,
|
49 |
min_length=min_response_length,
|
50 |
temperature=0.6, # Adjusted parameters
|
51 |
-
top_k=
|
52 |
-
top_p=0.
|
53 |
repetition_penalty=1.2,
|
54 |
no_repeat_ngram_size=3,
|
55 |
eos_token_id=tokenizer.eos_token_id,
|
@@ -61,7 +61,7 @@ def generate_response(user_input, chat_history):
|
|
61 |
|
62 |
followup_messages = []
|
63 |
|
64 |
-
if len(assistant_response.split()) <
|
65 |
# Generate additional response to continue context
|
66 |
followup_prompt = (f"This is a follow-up message to the previous assistant response. "
|
67 |
f"Continue the conversation smoothly and ensure it flows naturally based on the context.\n"
|
|
|
48 |
max_length=max_response_length,
|
49 |
min_length=min_response_length,
|
50 |
temperature=0.6, # Adjusted parameters
|
51 |
+
top_k=30,
|
52 |
+
top_p=0.55,
|
53 |
repetition_penalty=1.2,
|
54 |
no_repeat_ngram_size=3,
|
55 |
eos_token_id=tokenizer.eos_token_id,
|
|
|
61 |
|
62 |
followup_messages = []
|
63 |
|
64 |
+
if len(assistant_response.split()) < 8:
|
65 |
# Generate additional response to continue context
|
66 |
followup_prompt = (f"This is a follow-up message to the previous assistant response. "
|
67 |
f"Continue the conversation smoothly and ensure it flows naturally based on the context.\n"
|