Skip to content

Commit

Permalink
smaller font
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Oct 7, 2024
1 parent 07e0544 commit b7e7c3f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { babel } from "@rollup/plugin-babel";
import { wasm } from "@rollup/plugin-wasm";
import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";
import { splitVendorChunkPlugin } from 'vite';

export default [
{
Expand All @@ -16,6 +17,7 @@ export default [
{ file: "dist/index.cjs", format: "cjs" },
],
plugins: [
splitVendorChunkPlugin(),
nodeResolve({ browser: true }),
commonjs(),
babel({ babelHelpers: "bundled" }),
Expand Down
5 changes: 5 additions & 0 deletions src/sentencePieceProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ export class SentencePieceProcessor {
}
}

/**
* Function for cleaning text, removing invalid characters and replacing multiple whitespaces with a single space.
* @param text input text
* @returns a cleaned text
*/
export function cleanText(text: string) {
const stringBuilder: string[] = [];
let originalCharIndex = 0, newCharIndex = 0;
Expand Down
2 changes: 1 addition & 1 deletion tokenCount/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function App() {
const styles = useStyles();
return (
<>
<Card className={styles.card} size="large">
<Card className={styles.card} size="large" >
<CardHeader
header={
<Body1>
Expand Down
3 changes: 2 additions & 1 deletion tokenCount/src/components/TextAnalyzer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ function TextAnalyzer() {
className={styles.textarea}
textarea={{ className: styles.textareain }}
appearance="outline"
size="small"
id={textAnalyserId}
ref={textAreaRef}
placeholder="Enter text or drop a text file"
onDrop={handleDrop}
onChange={(event) => setText(event.target.value)}
></Textarea>
</Field>
<Text style={{width:"unset"}} className={styles.result} block>
<Text style={{width:"unset"}} className={styles.result} block size={300}>
<Button
appearance="primary"
onClick={calculateTokenCount}
Expand Down
12 changes: 11 additions & 1 deletion tokenCount/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@ import react from '@vitejs/plugin-react'
export default defineConfig({
base: '/sentencepiece-js/',
plugins: [react()],
})
build: {
rollupOptions: {
output: {
manualChunks: {
'sentencepiece-js': ['@sctg/sentencepiece-js'],
'fluentui-react-components': ['@fluentui/react-components'],
}
}
}
}
});

0 comments on commit b7e7c3f

Please sign in to comment.