Shreyas094 commited on
Commit
1ce1b84
·
verified ·
1 Parent(s): 9f7f526

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -53,8 +53,8 @@ SEARXNG_KEY = 'f9f07f93b37b8483aadb5ba717f556f3a4ac507b281b4ca01e6c6288aa3e3ae5'
53
  HF_TOKEN = os.getenv('HF_TOKEN')
54
 
55
  # Modify the client initialization to use the selected model
56
- def get_inference_client(model_name):
57
- return InferenceClient(model_name, token=HF_TOKEN)
58
 
59
  # Initialize the similarity model
60
  similarity_model = SentenceTransformer('all-MiniLM-L6-v2')
@@ -555,7 +555,7 @@ def chat_function(message, history, num_results, scraper, max_chars, time_range,
555
  chat_history = "\n".join([f"{role}: {msg}" for role, msg in history])
556
 
557
  # Get the client for the selected model
558
- client = get_inference_client(model_name)
559
 
560
  response = search_and_scrape(
561
  query=message,
 
53
  HF_TOKEN = os.getenv('HF_TOKEN')
54
 
55
  # Modify the client initialization to use the selected model
56
+
57
+ client = InferenceClient(model_name, token=HF_TOKEN)
58
 
59
  # Initialize the similarity model
60
  similarity_model = SentenceTransformer('all-MiniLM-L6-v2')
 
555
  chat_history = "\n".join([f"{role}: {msg}" for role, msg in history])
556
 
557
  # Get the client for the selected model
558
+ client = client(model_name)
559
 
560
  response = search_and_scrape(
561
  query=message,