Spaces:
Sleeping
Sleeping
new model
Browse files
app.py
CHANGED
|
@@ -185,12 +185,10 @@ qa_prompt = ChatPromptTemplate.from_template(
|
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
-
# =============================
|
| 189 |
# 4) LLM — Hugging Face Inference API (Llama 3 chat)
|
| 190 |
-
# =============================
|
| 191 |
endpoint = HuggingFaceEndpoint(
|
| 192 |
repo_id="meta-llama/Meta-Llama-3-8B-Instruct",
|
| 193 |
-
task="conversational",
|
| 194 |
max_new_tokens=2000,
|
| 195 |
temperature=0.1,
|
| 196 |
top_k=30,
|
|
@@ -201,8 +199,7 @@ endpoint = HuggingFaceEndpoint(
|
|
| 201 |
model_kwargs={},
|
| 202 |
)
|
| 203 |
|
| 204 |
-
|
| 205 |
-
llm = ChatHuggingFace(client=endpoint)
|
| 206 |
|
| 207 |
# ===========================================
|
| 208 |
# 5) Chain (memory + robust JSON extraction)
|
|
|
|
| 185 |
|
| 186 |
|
| 187 |
|
|
|
|
| 188 |
# 4) LLM — Hugging Face Inference API (Llama 3 chat)
|
|
|
|
| 189 |
endpoint = HuggingFaceEndpoint(
|
| 190 |
repo_id="meta-llama/Meta-Llama-3-8B-Instruct",
|
| 191 |
+
task="conversational", # <-- importante
|
| 192 |
max_new_tokens=2000,
|
| 193 |
temperature=0.1,
|
| 194 |
top_k=30,
|
|
|
|
| 199 |
model_kwargs={},
|
| 200 |
)
|
| 201 |
|
| 202 |
+
llm = ChatHuggingFace(llm=endpoint)
|
|
|
|
| 203 |
|
| 204 |
# ===========================================
|
| 205 |
# 5) Chain (memory + robust JSON extraction)
|