Fix huggingface tokenizer config
This commit is contained in:
parent
22eeae962a
commit
ce67d07269
|
|
@ -88,6 +88,7 @@ body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
background-color: var(--backgroundColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
.app {
|
.app {
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,9 @@ import { Header } from "./header/header";
|
||||||
import { Chat } from "./chat";
|
import { Chat } from "./chat";
|
||||||
import { Input } from "./input";
|
import { Input } from "./input";
|
||||||
|
|
||||||
import bgImage from '../assets/bg.jpg';
|
|
||||||
|
|
||||||
export const App = () => {
|
export const App = () => {
|
||||||
return (
|
return (
|
||||||
<div class='root' style={{ backgroundImage: `url('${bgImage.src}')` }}>
|
<div class='root'>
|
||||||
<div class='app'>
|
<div class='app'>
|
||||||
<Header />
|
<Header />
|
||||||
<Chat />
|
<Chat />
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,12 @@ export const ConnectionEditor = ({ connection, setConnection }: IProps) => {
|
||||||
Connection.getContextLength(connection).then(setContextLength);
|
Connection.getContextLength(connection).then(setContextLength);
|
||||||
} else if (connection.type === 'horde') {
|
} else if (connection.type === 'horde') {
|
||||||
Connection.getHordeModels()
|
Connection.getHordeModels()
|
||||||
.then(m => setHordeModels(Array.from(m.values()).sort((a, b) => a.name.localeCompare(b.name))));
|
.then(m => setHordeModels(Array.from(
|
||||||
|
m.values())
|
||||||
|
.sort((a, b) =>
|
||||||
|
b.maxContext - a.maxContext || a.name.localeCompare(b.name)
|
||||||
|
)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}, [connection]);
|
}, [connection]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,13 +66,14 @@
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lore {
|
.modal {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
min-height: 80dvh;
|
min-height: 80dvh;
|
||||||
|
}
|
||||||
|
|
||||||
.currentStory {
|
.currentStory {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
@ -83,9 +84,8 @@
|
||||||
height: 24px;
|
height: 24px;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.loreText {
|
.loreText {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -130,7 +130,7 @@ export const Header = () => {
|
||||||
<h3 class={styles.modalTitle}>Connection settings</h3>
|
<h3 class={styles.modalTitle}>Connection settings</h3>
|
||||||
<ConnectionEditor connection={connection} setConnection={setConnection} />
|
<ConnectionEditor connection={connection} setConnection={setConnection} />
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={loreOpen.value} onClose={loreOpen.setFalse} class={styles.lore}>
|
<Modal open={loreOpen.value} onClose={loreOpen.setFalse} class={styles.modal}>
|
||||||
<h3 class={styles.modalTitle}>Lore Editor</h3>
|
<h3 class={styles.modalTitle}>Lore Editor</h3>
|
||||||
<div class={styles.currentStory}>
|
<div class={styles.currentStory}>
|
||||||
<select value={currentStory} onChange={handleChangeStory} class={styles.storiesSelector}>
|
<select value={currentStory} onChange={handleChangeStory} class={styles.storiesSelector}>
|
||||||
|
|
@ -152,7 +152,7 @@ export const Header = () => {
|
||||||
class={styles.loreText}
|
class={styles.loreText}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal open={genparamsOpen.value} onClose={genparamsOpen.setFalse}>
|
<Modal open={genparamsOpen.value} onClose={genparamsOpen.setFalse} class={styles.modal}>
|
||||||
<h3 class={styles.modalTitle}>Generation Parameters</h3>
|
<h3 class={styles.modalTitle}>Generation Parameters</h3>
|
||||||
<div className={styles.scrollPane}>
|
<div className={styles.scrollPane}>
|
||||||
<h4 class={styles.modalTitle}>Banned phrases</h4>
|
<h4 class={styles.modalTitle}>Banned phrases</h4>
|
||||||
|
|
|
||||||
|
|
@ -104,9 +104,12 @@ export namespace Huggingface {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log(`[huggingface] searching config in '${name}/tokenizer_config.json'`);
|
console.log(`[huggingface] searching config in '${name}/tokenizer_config.json'`);
|
||||||
const fileResponse = await hub.downloadFile({ repo: name, path: 'tokenizer_config.json' });
|
const fileResponse = await hub.downloadFile({
|
||||||
|
repo: name,
|
||||||
|
path: 'tokenizer_config.json',
|
||||||
|
});
|
||||||
if (fileResponse) {
|
if (fileResponse) {
|
||||||
const maybeConfig = await fileResponse.json();
|
const maybeConfig = JSON.parse(await fileResponse.text());
|
||||||
if (isTokenizerConfig(maybeConfig)) {
|
if (isTokenizerConfig(maybeConfig)) {
|
||||||
tokenizerConfig = maybeConfig;
|
tokenizerConfig = maybeConfig;
|
||||||
foundName = `${name}/tokenizer_config.json`;
|
foundName = `${name}/tokenizer_config.json`;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue