Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import gradio as gr
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
import numpy as np
|
| 5 |
import torch
|
|
|
|
| 6 |
|
| 7 |
with open("knowledge.txt", "r", encoding="utf-8") as file:
|
| 8 |
knowledge_base = file.read()
|
|
@@ -70,8 +71,7 @@ top_results = get_top_chunks("Your account has been compromised", chunk_embeddin
|
|
| 70 |
|
| 71 |
cleaned_chunks = preprocess_text(knowledge_base)
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
def respond(message, history):
|
| 76 |
top_chunks = get_top_chunks(message, chunk_embeddings, cleaned_chunks)
|
| 77 |
context = "\n".join(top_chunks)
|
|
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
import numpy as np
|
| 5 |
import torch
|
| 6 |
+
import os
|
| 7 |
|
| 8 |
with open("knowledge.txt", "r", encoding="utf-8") as file:
|
| 9 |
knowledge_base = file.read()
|
|
|
|
| 71 |
|
| 72 |
cleaned_chunks = preprocess_text(knowledge_base)
|
| 73 |
|
| 74 |
+
InferenceClient("Qwen/Qwen2.5-7B-Instruct", token=os.getenv("BYTESHIELD_TOKEN"))
|
|
|
|
| 75 |
def respond(message, history):
|
| 76 |
top_chunks = get_top_chunks(message, chunk_embeddings, cleaned_chunks)
|
| 77 |
context = "\n".join(top_chunks)
|