diff --git a/examples/rag-playground/src/components/app/app.ts b/examples/rag-playground/src/components/app/app.ts index fda8554..c5caa18 100644 --- a/examples/rag-playground/src/components/app/app.ts +++ b/examples/rag-playground/src/components/app/app.ts @@ -7,6 +7,37 @@ import componentCSS from './app.css?inline'; import logoIcon from '../../images/icon-logo.svg?raw'; import { Dataset } from '../playground/playground'; +let defaultDataset = Dataset.arXiv10k; + +// Check url query to change the view +if (window.location.search !== '') { + const searchParams = new URLSearchParams(window.location.search); + if (searchParams.has('dataset')) { + const modelName = searchParams.get('dataset')!; + + switch (modelName) { + case 'paper': { + defaultDataset = Dataset.arXiv10k; + break; + } + + case 'diffusiondb': { + defaultDataset = Dataset.DiffusionDB10k; + break; + } + + case 'accident': { + defaultDataset = Dataset.accident3k; + break; + } + + default: { + break; + } + } + } +} + /** * App element. * @@ -24,7 +55,7 @@ export class MememoRagPlayground extends LitElement { //==========================================================================|| constructor() { super(); - this.curDataset = Dataset.arXiv1k; + this.curDataset = defaultDataset; } /** diff --git a/examples/rag-playground/src/components/playground/playground.ts b/examples/rag-playground/src/components/playground/playground.ts index 8241515..ffded74 100644 --- a/examples/rag-playground/src/components/playground/playground.ts +++ b/examples/rag-playground/src/components/playground/playground.ts @@ -139,7 +139,7 @@ export class MememoPlayground extends LitElement { // Class Properties || //==========================================================================|| @property() - curDataset: Dataset = Dataset.arXiv10k; + curDataset!: Dataset; @state() userQuery = ''; diff --git a/examples/rag-playground/src/components/query-box/query-box.ts b/examples/rag-playground/src/components/query-box/query-box.ts index ab7cb82..5b65968 100644 --- a/examples/rag-playground/src/components/query-box/query-box.ts +++ b/examples/rag-playground/src/components/query-box/query-box.ts @@ -30,7 +30,7 @@ export class MememoQueryBox extends LitElement { //==========================================================================|| constructor() { super(); - this.userQuery = this.defaultQuery; + this.userQuery = ''; } firstUpdated() { diff --git a/examples/rag-playground/src/config/userQueries.ts b/examples/rag-playground/src/config/userQueries.ts index 68520cb..22ef2ea 100644 --- a/examples/rag-playground/src/config/userQueries.ts +++ b/examples/rag-playground/src/config/userQueries.ts @@ -25,7 +25,7 @@ const arXivQueries = [ ]; const diffusiondbQueries: string[] = [ - 'A cute brown dog jumping around', + 'A cute brown dog jumps around the tree', 'White dog wandering through a dense forest', 'Red apple resting on an aged wooden table', 'Sunny field dotted with vibrant sunflowers', diff --git a/examples/rag-playground/vite.config.ts b/examples/rag-playground/vite.config.ts index 88df2fe..6adf778 100644 --- a/examples/rag-playground/vite.config.ts +++ b/examples/rag-playground/vite.config.ts @@ -34,7 +34,7 @@ export default defineConfig(({ command, mode }) => { case 'github': { // Production: github page (default mode) return { - base: '/wordflow/', + base: '/mememo/', build: { outDir: 'dist', rollupOptions: {