KalooAI commited on
Commit
2c6f1f7
·
verified ·
1 Parent(s): d5206b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -60,21 +60,20 @@ client = InferenceClient(HF_MODEL_ID, token=os.getenv("HF_TOKEN"))
60
  import os
61
  from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
62
 
63
- hf_token = os.getenv("HF_TOKEN")
 
 
64
 
65
- # 1. Create the endpoint with the 'conversational' task
66
  llm_endpoint = HuggingFaceEndpoint(
67
- #repo_id="mistralai/Mistral-7B-Instruct-v0.3",
68
- repo_id = "HuggingFaceH4/zephyr-7b-beta",
69
  task="text-generation",
70
  max_new_tokens=512,
71
- huggingfacehub_api_token=hf_token,
72
  )
73
 
74
- # 2. Wrap it in ChatHuggingFace
75
- # This is REQUIRED for conversational tasks to work with RAG chains
76
  llm = ChatHuggingFace(llm=llm_endpoint)
77
-
78
  # -------------------------
79
  # Document loader
80
  # -------------------------
 
60
  import os
61
  from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
62
 
63
+ # 1. Use a model that has high availability in the 2026 Provider network
64
+ # Llama-3.1-8B-Instruct is currently a 'gold standard' for this router
65
+ repo_id = "meta-llama/Llama-3.1-8B-Instruct"
66
 
 
67
  llm_endpoint = HuggingFaceEndpoint(
68
+ repo_id=repo_id,
 
69
  task="text-generation",
70
  max_new_tokens=512,
71
+ huggingfacehub_api_token=os.getenv("HF_TOKEN"),
72
  )
73
 
74
+ # 2. ChatHuggingFace will correctly route this to the /v1/chat/completions
75
+ # endpoint which the Llama-3.1-8B-Instruct model supports.
76
  llm = ChatHuggingFace(llm=llm_endpoint)
 
77
  # -------------------------
78
  # Document loader
79
  # -------------------------