Spaces:
Build error
Build error
clean up the knowledge file path
Browse files
app.py
CHANGED
|
@@ -1,15 +1,13 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient #imports huggingface models
|
| 3 |
import os
|
| 4 |
-
|
| 5 |
from sentence_transformers import SentenceTransformer
|
| 6 |
import torch
|
| 7 |
import numpy as np
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
#load and process the knowledge base text file
|
| 12 |
-
with open("
|
| 13 |
knowledge_text = f.read()
|
| 14 |
|
| 15 |
#split the text into chunks
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient #imports huggingface models
|
| 3 |
import os
|
| 4 |
+
import difflib # for fuzzy matching
|
| 5 |
from sentence_transformers import SentenceTransformer
|
| 6 |
import torch
|
| 7 |
import numpy as np
|
| 8 |
|
|
|
|
|
|
|
| 9 |
#load and process the knowledge base text file
|
| 10 |
+
with open("knowledge.txt", "r", encoding="utf-8") as f:
|
| 11 |
knowledge_text = f.read()
|
| 12 |
|
| 13 |
#split the text into chunks
|