Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ def load_json_data():
|
|
| 27 |
data = load_json_data()
|
| 28 |
|
| 29 |
# 🔹 Initialize FAISS for Searching Relevant Answers
|
| 30 |
-
model = SentenceTransformer("all-MiniLM-
|
| 31 |
|
| 32 |
def create_faiss_index(data):
|
| 33 |
texts = list(data.values())
|
|
@@ -45,7 +45,7 @@ def search_faiss(query, top_k=1):
|
|
| 45 |
return texts[indices[0][0]] if indices[0][0] < len(texts) else "No relevant information found."
|
| 46 |
|
| 47 |
# 🔹 Hugging Face API for Additional Responses
|
| 48 |
-
client = InferenceClient("
|
| 49 |
|
| 50 |
def get_huggingface_response(query):
|
| 51 |
messages = [{"role": "system", "content": "Provide accurate food stamp information for Colorado."},
|
|
|
|
| 27 |
data = load_json_data()
|
| 28 |
|
| 29 |
# 🔹 Initialize FAISS for Searching Relevant Answers
|
| 30 |
+
model = SentenceTransformer("all-MiniLM-L12-v2") # Faster with good accuracy
|
| 31 |
|
| 32 |
def create_faiss_index(data):
|
| 33 |
texts = list(data.values())
|
|
|
|
| 45 |
return texts[indices[0][0]] if indices[0][0] < len(texts) else "No relevant information found."
|
| 46 |
|
| 47 |
# 🔹 Hugging Face API for Additional Responses
|
| 48 |
+
client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct")
|
| 49 |
|
| 50 |
def get_huggingface_response(query):
|
| 51 |
messages = [{"role": "system", "content": "Provide accurate food stamp information for Colorado."},
|