Spaces:
Running
Running
Update app.py
Browse files
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 = "
|
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="
|
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
|
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="
|
|
|
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"]},
|