Tesneem commited on
Commit
b99c74d
·
verified ·
1 Parent(s): d2155df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -58,7 +58,7 @@ def init_vector_search() -> MongoDBAtlasVectorSearch:
58
  from langchain_community.vectorstores import MongoDBAtlasVectorSearch
59
 
60
  HF_TOKEN = os.getenv("HF_TOKEN", "").strip()
61
- model_name = "sentence-transformers/paraphrase-MiniLM-L6-v2"
62
 
63
  try:
64
  st.write(f"🔌 Connecting to Hugging Face model: `{model_name}`")
@@ -114,7 +114,7 @@ def generate_response(input_dict: Dict[str, Any]) -> str:
114
 
115
  try:
116
  response = client.chat.completions.create(
117
- model="Qwen/Qwen2.5-1.5B-Instruct",
118
  messages=[
119
  {"role": "system", "content": prompt},
120
  {"role": "user", "content": input_dict["question"]},
@@ -418,13 +418,14 @@ if __name__ == "__main__":
418
 
419
  # # Notes
420
  # # -----
421
- # # Uses Qwen2.5-1.5B-Instruct model with controlled temperature
422
  # # """
423
  # # hf_client = InferenceClient(api_key=self.HF_TOKEN)
424
  # # formatted_prompt = self.prompt.format(**input_dict)
425
 
426
  # # response = hf_client.chat.completions.create(
427
- # # model="Qwen/Qwen2.5-1.5B-Instruct",
 
428
  # # messages=[
429
  # # {"role": "system", "content": formatted_prompt},
430
  # # {"role": "user", "content": input_dict["question"]},
 
58
  from langchain_community.vectorstores import MongoDBAtlasVectorSearch
59
 
60
  HF_TOKEN = os.getenv("HF_TOKEN", "").strip()
61
+ model_name = "intfloat/e5-small-v2"
62
 
63
  try:
64
  st.write(f"🔌 Connecting to Hugging Face model: `{model_name}`")
 
114
 
115
  try:
116
  response = client.chat.completions.create(
117
+ model="HuggingFaceH4/zephyr-7b-beta",
118
  messages=[
119
  {"role": "system", "content": prompt},
120
  {"role": "user", "content": input_dict["question"]},
 
418
 
419
  # # Notes
420
  # # -----
421
+ # # Uses Zephyr model with controlled temperature
422
  # # """
423
  # # hf_client = InferenceClient(api_key=self.HF_TOKEN)
424
  # # formatted_prompt = self.prompt.format(**input_dict)
425
 
426
  # # response = hf_client.chat.completions.create(
427
+ # # model="HuggingFaceH4/zephyr-7b-beta"
428
+ ,
429
  # # messages=[
430
  # # {"role": "system", "content": formatted_prompt},
431
  # # {"role": "user", "content": input_dict["question"]},