Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,12 +18,13 @@ if "HUGGINGFACEHUB_API_TOKEN" not in os.environ:
|
|
| 18 |
|
| 19 |
# --- LLM and Template Configuration ---
|
| 20 |
llm = HuggingFaceEndpoint(
|
| 21 |
-
repo_id="
|
| 22 |
temperature=0.7,
|
| 23 |
max_new_tokens=512,
|
| 24 |
huggingfacehub_api_token=os.getenv("HUGGINGFACEHUB_API_TOKEN"),
|
| 25 |
-
task="text2text-generation
|
| 26 |
)
|
|
|
|
| 27 |
math_template = ChatPromptTemplate.from_messages([
|
| 28 |
("system", """{system_message}
|
| 29 |
You are an expert math tutor. For every math problem:
|
|
|
|
| 18 |
|
| 19 |
# --- LLM and Template Configuration ---
|
| 20 |
llm = HuggingFaceEndpoint(
|
| 21 |
+
repo_id="HuggingFaceH4/zephyr-7b-alpha", # inference-ready model
|
| 22 |
temperature=0.7,
|
| 23 |
max_new_tokens=512,
|
| 24 |
huggingfacehub_api_token=os.getenv("HUGGINGFACEHUB_API_TOKEN"),
|
| 25 |
+
task="text-generation" # <— important: use text-generation, not text2text-generation
|
| 26 |
)
|
| 27 |
+
|
| 28 |
math_template = ChatPromptTemplate.from_messages([
|
| 29 |
("system", """{system_message}
|
| 30 |
You are an expert math tutor. For every math problem:
|