Skip to content

Commit f259715

Browse files
committed
fix lint
1 parent 897190d commit f259715

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/ollama-utils/src/chat-template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Template as JinjaTemplate } from "@huggingface/jinja";
22
import { OLLAMA_CHAT_TEMPLATE_MAPPING } from "./chat-template-automap";
3-
import { GGUFParsedInfo, OllamaCustomMappedTemplate, OllamaChatTemplateMapEntry } from "./types";
3+
import type { GGUFParsedInfo, OllamaCustomMappedTemplate, OllamaChatTemplateMapEntry } from "./types";
44

55
// regex for finding special tokens inside chat template
66
const RE_SPECIAL_TOKEN = /<[|_A-Za-z0-9]+>|\[[A-Z]+\]|<\uFF5C[\u2581A-Za-z]+\uFF5C>/g;
@@ -224,7 +224,7 @@ function convertJinjaToGoTemplate(gguf: NonNullable<GGUFParsedInfo>):
224224
const formattedUserContent = formattedUser.replace("{{ .Prompt }}", "{{ .Content }}");
225225
const formattedRespContent = formattedResp.replace("{{ .Response }}", "{{ .Content }}");
226226
const addedAssistantPrompt = formattedResp.split("{{ .Response }}")[0];
227-
goTmpl = `${formattedSystem}{{- range .Messages }}{{- if eq .Role \"user\" }}${formattedUserContent}{{- else if eq .Role \"assistant\" }}${formattedRespContent}{{- end }}{{- end }}${addedAssistantPrompt}`;
227+
goTmpl = `${formattedSystem}{{- range .Messages }}{{- if eq .Role "user" }}${formattedUserContent}{{- else if eq .Role "assistant" }}${formattedRespContent}{{- end }}{{- end }}${addedAssistantPrompt}`;
228228
}
229229

230230
// we get the stop token by only keeping the first part of formattedResp

packages/ollama-utils/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface OllamaChatTemplateMapEntry {
1717
tokens: string[];
1818
params?: {
1919
stop?: string[];
20+
// eslint-disable-next-line
2021
[key: string]: any;
2122
};
2223
};

0 commit comments

Comments
 (0)