nsarrazin HF Staff commited on
Commit
d37f9ca
·
unverified ·
1 Parent(s): 185c2ff

feat: improve task model tool calling (#1755)

Browse files

* feat: improve task model tool calling

* feat(prod): add tokenizer for Hermes-3-Llama-3.1-8B to task configuration

chart/env/prod.yaml CHANGED
@@ -375,11 +375,17 @@ envVars:
375
  ]
376
  },
377
  {
378
- "name": "meta-llama/Llama-3.1-8B-Instruct",
379
- "tools": true,
380
  "unlisted": true,
 
 
 
 
 
 
 
381
  "parameters": {
382
- "stop": ["<|eot_id|>", "<|im_end|>"],
383
  "temperature": 0.1,
384
  "max_new_tokens": 256
385
  }
@@ -456,7 +462,7 @@ envVars:
456
  PUBLIC_APP_DISCLAIMER: 1
457
  PUBLIC_PLAUSIBLE_SCRIPT_URL: "/js/script.js"
458
  REQUIRE_FEATURED_ASSISTANTS: "true"
459
- TASK_MODEL: "meta-llama/Llama-3.1-8B-Instruct"
460
  TEXT_EMBEDDING_MODELS: >
461
  [{
462
  "name": "bge-base-en-v1-5-sxa",
 
375
  ]
376
  },
377
  {
378
+ "name": "internal/task",
379
+ "tokenizer" : "NousResearch/Hermes-3-Llama-3.1-8B",
380
  "unlisted": true,
381
+ "tools" : true,
382
+ "endpoints": [
383
+ {
384
+ "type": "openai",
385
+ "baseURL": "https://internal.api-inference.huggingface.co/models/NousResearch/Hermes-3-Llama-3.1-8B/v1"
386
+ }
387
+ ],
388
  "parameters": {
 
389
  "temperature": 0.1,
390
  "max_new_tokens": 256
391
  }
 
462
  PUBLIC_APP_DISCLAIMER: 1
463
  PUBLIC_PLAUSIBLE_SCRIPT_URL: "/js/script.js"
464
  REQUIRE_FEATURED_ASSISTANTS: "true"
465
+ TASK_MODEL: "internal/task"
466
  TEXT_EMBEDDING_MODELS: >
467
  [{
468
  "name": "bge-base-en-v1-5-sxa",
src/lib/server/textGeneration/reasoning.ts CHANGED
@@ -15,7 +15,7 @@ export async function generateSummaryOfReasoning(buffer: string): Promise<string
15
  ];
16
 
17
  const preprompt = `You are tasked with submitting a summary of the latest reasoning steps into a tool. Never describe results of the reasoning, only the process. Remain vague in your summary.
18
- The text might be incomplete, try your best to summarize it in one very short sentence, starting with a gerund and ending with three points. The reasoning follows: \n`;
19
 
20
  if (smallModel.tools) {
21
  const summaryTool = {
@@ -25,7 +25,8 @@ The text might be incomplete, try your best to summarize it in one very short se
25
  {
26
  name: "summary",
27
  type: "str",
28
- description: "The short summary of the reasoning steps",
 
29
  paramType: "required",
30
  },
31
  ],
 
15
  ];
16
 
17
  const preprompt = `You are tasked with submitting a summary of the latest reasoning steps into a tool. Never describe results of the reasoning, only the process. Remain vague in your summary.
18
+ The text might be incomplete, try your best to summarize it in one very short sentence, starting with a gerund and ending with three points. The sentence must be very short, ideally 5 words or less.`;
19
 
20
  if (smallModel.tools) {
21
  const summaryTool = {
 
25
  {
26
  name: "summary",
27
  type: "str",
28
+ description:
29
+ "The short summary of the reasoning steps. 5 words or less. Must start with a gerund.",
30
  paramType: "required",
31
  },
32
  ],
src/lib/server/textGeneration/title.ts CHANGED
@@ -43,7 +43,7 @@ export async function generateTitle(prompt: string) {
43
  name: "title",
44
  type: "str",
45
  description:
46
- "The title for the conversation. It should be a single short sentence of four words or less and start with a unicode emoji relevant to the conversation.",
47
  },
48
  ],
49
  } as unknown as Tool;
@@ -57,7 +57,7 @@ export async function generateTitle(prompt: string) {
57
  },
58
  ],
59
  preprompt:
60
- "You are a summarization AI. You'll never answer a user's question directly, but instead summarize the user's request into a single short sentence. Here is the user message: \n",
61
  tool: titleTool,
62
  endpoint,
63
  });
@@ -76,7 +76,7 @@ export async function generateTitle(prompt: string) {
76
  preprompt:
77
  "You are a summarization AI. Summarize the user's request into a single short sentence of four words or less. Do not try to answer it, only summarize the user's query. Always start your answer with an emoji relevant to the summary",
78
  generateSettings: {
79
- max_new_tokens: 15,
80
  },
81
  })
82
  )
 
43
  name: "title",
44
  type: "str",
45
  description:
46
+ "The title for the conversation. It should be 5 words or less and start with a unicode emoji relevant to the query.",
47
  },
48
  ],
49
  } as unknown as Tool;
 
57
  },
58
  ],
59
  preprompt:
60
+ "The task is to generate conversation titles based on text snippets. You'll never answer the provided question directly, but instead summarize the user's request into a short title.",
61
  tool: titleTool,
62
  endpoint,
63
  });
 
76
  preprompt:
77
  "You are a summarization AI. Summarize the user's request into a single short sentence of four words or less. Do not try to answer it, only summarize the user's query. Always start your answer with an emoji relevant to the summary",
78
  generateSettings: {
79
+ max_new_tokens: 30,
80
  },
81
  })
82
  )