Skip to content

Commit

Permalink
Partially fixed virtual assistant demo on mac (#121)
Browse files Browse the repository at this point in the history
* Update requirements.txt

* Update requirements.txt

* Update requirements.txt

* Update main.py

* Update requirements.txt

* Update main.py

* Updated dependecies
  • Loading branch information
adrianboguszewski authored Jan 8, 2025
1 parent 8c64838 commit e416b56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions demos/virtual_ai_assistant_demo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from pathlib import Path
from typing import List, Optional, Set

import faiss
import fitz
import gradio as gr
import numpy as np
Expand All @@ -26,6 +25,9 @@
from optimum.intel import OVModelForCausalLM, OVModelForFeatureExtraction, OVWeightQuantizationConfig, OVConfig, OVQuantizer, OVModelForSequenceClassification
from transformers import AutoTokenizer

# it must be imported as the last one; otherwise, it causes a crash on macOS
import faiss

# Global variables initialization
MODEL_DIR = Path("model")
inference_lock = threading.Lock()
Expand Down Expand Up @@ -311,7 +313,7 @@ def run(chat_model_name: str, embedding_model_name: str, reranker_model_name: st
parser = argparse.ArgumentParser()
parser.add_argument("--chat_model", type=str, default="meta-llama/Llama-3.2-3B-Instruct", help="Path/name of the chat model")
parser.add_argument("--embedding_model", type=str, default="BAAI/bge-small-en-v1.5", help="Path/name of the model for embeddings")
parser.add_argument("--reranker_model", type=str, default="BAAI/bge-base-en-v1.5", help="Path/name of the reranker model")
parser.add_argument("--reranker_model", type=str, default="BAAI/bge-reranker-base", help="Path/name of the reranker model")
parser.add_argument("--personality", type=str, default="healthcare_personality.yaml", help="Path to the YAML file with chatbot personality")
parser.add_argument("--hf_token", type=str, help="HuggingFace access token to get Llama3")
parser.add_argument("--public", default=False, action="store_true", help="Whether interface should be available publicly")
Expand Down

0 comments on commit e416b56

Please sign in to comment.