Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from sentence_transformers import SentenceTransformer, util
|
3 |
import openai
|
|
|
4 |
import os
|
5 |
|
6 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
@@ -650,7 +651,8 @@ def generate_recommendation(criteria):
|
|
650 |
f"Visit their website for more details: {result['website']}"
|
651 |
)
|
652 |
recommendations.append(recommendation)
|
653 |
-
|
|
|
654 |
else:
|
655 |
return "Sorry, no restaurants meet your criteria. Please try adjusting your filters."
|
656 |
|
|
|
1 |
import gradio as gr
|
2 |
from sentence_transformers import SentenceTransformer, util
|
3 |
import openai
|
4 |
+
import random
|
5 |
import os
|
6 |
|
7 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
|
|
651 |
f"Visit their website for more details: {result['website']}"
|
652 |
)
|
653 |
recommendations.append(recommendation)
|
654 |
+
random_index = random.randint(0, len(recommendations) - 1)
|
655 |
+
return recommendations[random_index]
|
656 |
else:
|
657 |
return "Sorry, no restaurants meet your criteria. Please try adjusting your filters."
|
658 |
|