enzostvs HF staff commited on
Commit
e2bd146
·
1 Parent(s): c8dbfbe

preview textgen

Browse files
src/lib/components/text-generation/Preview.svelte CHANGED
@@ -4,7 +4,8 @@
4
  </script>
5
 
6
  <div class="text-white p-6 font-code text-xs !leading-loose">
7
- {#if res?.[0]?.translation_text}
8
- {res[0]?.translation_text}
 
9
  {/if}
10
  </div>
 
4
  </script>
5
 
6
  <div class="text-white p-6 font-code text-xs !leading-loose">
7
+ {body.inputs ?? "No input provided"}
8
+ {#if res?.[0]?.generated_text}
9
+ <span>{res[0]?.generated_text?.replace(body?.inputs, "")}</span>
10
  {/if}
11
  </div>
src/lib/components/translation/Preview.svelte ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <script lang="ts">
2
+ export let body: Record<string, any>;
3
+ export let res: Record<string, any>;
4
+ </script>
5
+
6
+ <div class="text-white p-6 font-code text-xs !leading-loose">
7
+ {#if res?.[0]?.translation_text}
8
+ {res[0]?.translation_text}
9
+ {/if}
10
+ </div>
src/lib/components/translation/Response.svelte CHANGED
@@ -6,7 +6,7 @@
6
 
7
  import Loading from "$lib/components/Loading.svelte"
8
  import CodePreview from '$lib/components/CodePreview.svelte';
9
- import Preview from '$lib/components/text-generation/Preview.svelte';
10
 
11
  export let loading: boolean;
12
  export let res: any;
 
6
 
7
  import Loading from "$lib/components/Loading.svelte"
8
  import CodePreview from '$lib/components/CodePreview.svelte';
9
+ import Preview from '$lib/components/translation/Preview.svelte';
10
 
11
  export let loading: boolean;
12
  export let res: any;