Update app.py
Browse files
app.py
CHANGED
|
@@ -61,11 +61,10 @@ class RetrieverTool(Tool):
|
|
| 61 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 62 |
"""
|
| 63 |
HF_TOKEN=os.getenv('TOKEN')
|
| 64 |
-
print(HF_TOKEN)
|
| 65 |
login(HF_TOKEN)
|
| 66 |
|
| 67 |
-
model = "meta-llama/Meta-Llama-3-8B-Instruct"
|
| 68 |
-
|
| 69 |
|
| 70 |
client = InferenceClient(model)
|
| 71 |
|
|
@@ -76,7 +75,7 @@ embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/paraphrase-
|
|
| 76 |
vector_db = FAISS.load_local("faiss_index_mpnet_cos", embeddings, allow_dangerous_deserialization=True, distance_strategy=DistanceStrategy.COSINE)
|
| 77 |
|
| 78 |
df = pd.read_csv("bger_cedh_db 1954-2024.csv")
|
| 79 |
-
|
| 80 |
retriever_tool = RetrieverTool(vector_db)
|
| 81 |
agent = ToolCallingAgent(tools=[retriever_tool], model=HfApiModel(model))
|
| 82 |
|
|
|
|
| 61 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 62 |
"""
|
| 63 |
HF_TOKEN=os.getenv('TOKEN')
|
|
|
|
| 64 |
login(HF_TOKEN)
|
| 65 |
|
| 66 |
+
#model = "meta-llama/Meta-Llama-3-8B-Instruct"
|
| 67 |
+
model = "swiss-ai/Apertus-8B-Instruct-2509"
|
| 68 |
|
| 69 |
client = InferenceClient(model)
|
| 70 |
|
|
|
|
| 75 |
vector_db = FAISS.load_local("faiss_index_mpnet_cos", embeddings, allow_dangerous_deserialization=True, distance_strategy=DistanceStrategy.COSINE)
|
| 76 |
|
| 77 |
df = pd.read_csv("bger_cedh_db 1954-2024.csv")
|
| 78 |
+
|
| 79 |
retriever_tool = RetrieverTool(vector_db)
|
| 80 |
agent = ToolCallingAgent(tools=[retriever_tool], model=HfApiModel(model))
|
| 81 |
|