Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,8 +40,8 @@ if user_input:
|
|
40 |
# Run sentiment analysis to check for distress
|
41 |
sentiment = sentiment_analysis(user_input)[0]
|
42 |
|
43 |
-
# Generate multiple responses with increased randomness
|
44 |
-
responses = conversational_bot(user_input, max_length=300, temperature=1, top_k=50, num_return_sequences=3)
|
45 |
|
46 |
# Filter out any responses that are too similar to previous responses
|
47 |
new_responses = [response['generated_text'] for response in responses]
|
|
|
40 |
# Run sentiment analysis to check for distress
|
41 |
sentiment = sentiment_analysis(user_input)[0]
|
42 |
|
43 |
+
# Generate multiple responses with increased randomness (top_k_sampling)
|
44 |
+
responses = conversational_bot(user_input, max_length=300, temperature=1, top_k=50, num_return_sequences=3, do_sample=True)
|
45 |
|
46 |
# Filter out any responses that are too similar to previous responses
|
47 |
new_responses = [response['generated_text'] for response in responses]
|