huuquyet commited on
Commit
bd650ac
β€’
1 Parent(s): 65d62a2

feat: using tamagui

Browse files
Files changed (49) hide show
  1. 404.html +1 -1
  2. _next/static/{UPicdb8faPBPzSbOulfRb β†’ 2yIdB6J6TFtzbtR43oIj6}/_buildManifest.js +1 -1
  3. _next/static/{UPicdb8faPBPzSbOulfRb β†’ 2yIdB6J6TFtzbtR43oIj6}/_ssgManifest.js +0 -0
  4. _next/static/chunks/107-24dc2a03cc950c79.js +0 -0
  5. _next/static/chunks/190-b97855758bb23886.js +0 -0
  6. _next/static/chunks/40bfc07d-7d2b96f8f95c7906.js +0 -1
  7. _next/static/chunks/528-278ce8f7ba7eac7e.js +0 -0
  8. _next/static/chunks/{5f09d46c-d4955f71949979a4.js β†’ 590caa2a.699039c37022246b.js} +1 -1
  9. _next/static/chunks/6139e184.ec466d5482164223.js +1 -0
  10. _next/static/chunks/616-4a3447e4a89711ca.js +0 -0
  11. _next/static/chunks/66.deca4787bfb39346.js +1 -0
  12. _next/static/chunks/842.3f8418770ac3440a.js +0 -0
  13. _next/static/chunks/app/_not-found/{page-71aafbb9ff8a5bfb.js β†’ page-c3d72fd6c9f4f96a.js} +1 -1
  14. _next/static/chunks/app/layout-5f9b9579766ec96a.js +0 -1
  15. _next/static/chunks/app/layout-b185c3776a59f483.js +1 -0
  16. _next/static/chunks/app/page-73a00cac215b7d81.js +1 -0
  17. _next/static/chunks/app/page-f4b111521485cce9.js +0 -1
  18. _next/static/chunks/{c9e07ca6-4ee53eda494071d7.js β†’ b2db8554.2f90d90ec938bc93.js} +0 -0
  19. _next/static/chunks/{d0d14972-f06041a19692f927.js β†’ fd9d1056-8fba21ecb5fa45b6.js} +0 -0
  20. _next/static/chunks/{framework-2a0f2580bcbf19fb.js β†’ framework-aec844d2ccbe7592.js} +0 -0
  21. _next/static/chunks/main-7111bfe9b3c4c0d0.js +0 -0
  22. _next/static/chunks/main-app-8591d221f05263ff.js +1 -0
  23. _next/static/chunks/main-app-aee585b6ec97b206.js +0 -1
  24. _next/static/chunks/main-fb740fb39bc15572.js +0 -0
  25. _next/static/chunks/pages/_app-6a626577ffa902a4.js +1 -0
  26. _next/static/chunks/pages/_app-da5442636db34eba.js +0 -1
  27. _next/static/chunks/pages/_error-10ab295e4702c5ac.js +0 -1
  28. _next/static/chunks/pages/_error-1be831200e60c5c0.js +1 -0
  29. _next/static/chunks/webpack-76c22cfb480fa812.js +0 -1
  30. _next/static/chunks/webpack-cb993d10a9392443.js +1 -0
  31. _next/static/css/2f64c11402f89eba.css +0 -3
  32. _next/static/css/c07dfed9e589ce2b.css +0 -0
  33. images/adaptive-icon.png +0 -0
  34. {icons β†’ images}/android-icon-192x192.png +0 -0
  35. {icons β†’ images}/android-icon-512x512.png +0 -0
  36. {icons β†’ images}/apple-icon-16x16.png +0 -0
  37. {icons β†’ images}/apple-icon-32x32.png +0 -0
  38. icons/apple-touch-icon.png β†’ images/apple-icon.png +0 -0
  39. images/favicon.png +0 -0
  40. images/icon.png +0 -0
  41. {icons β†’ images}/safari-pinned-tab.svg +0 -0
  42. {icons β†’ images}/share.png +0 -0
  43. images/splash.png +0 -0
  44. index.html +1 -1
  45. index.txt +7 -8
  46. manifest.json +3 -3
  47. sw.js +1 -1
  48. tamagui.css +0 -0
  49. workbox-cb82a8da.js β†’ workbox-c06b064f.js +0 -0
404.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-76c22cfb480fa812.js"/><script src="/_next/static/chunks/d0d14972-f06041a19692f927.js" async=""></script><script src="/_next/static/chunks/616-4a3447e4a89711ca.js" async=""></script><script src="/_next/static/chunks/main-app-aee585b6ec97b206.js" async=""></script><script src="/_next/static/chunks/app/layout-5f9b9579766ec96a.js" async=""></script><title>404: This page could not be found.</title><title>Translator demo app built with Transformers.js + Tamagui + Next.js</title><meta name="description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta name="application-name" content="Translator Demo"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><meta name="keywords" content="Translator,Transformers.js,Next.js,Tamagui"/><meta name="format-detection" content="telephone=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><meta property="og:title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta property="og:description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta property="og:url" content="https://hf.co/spaces/huuquyet/translator-tamagui/"/><meta property="og:site_name" content="Translator Demo"/><meta property="og:image" content="https://${process.env.vercel_url}/icon/share.png"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@HuuQuyetNg"/><meta name="twitter:title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta name="twitter:description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta name="twitter:image" content="https://${process.env.vercel_url}/icon/share.png"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--><script src="/_next/static/chunks/webpack-76c22cfb480fa812.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:I[2321,[],\"\"]\n3:I[6113,[],\"\"]\n4:I[4245,[],\"\"]\n9:I[3982,[\"185\",\"static/chunks/app/layout-5f9b9579766ec96a.js\"],\"Analytics\"]\nb:I[2314,[],\"\"]\n5:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n6:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n7:{\"display\":\"inline-block\"}\n8:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[null,[\"$\",\"$L1\",null,{\"buildId\":\"UPicdb8faPBPzSbOulfRb\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/_not-found\",\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L2\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]]],null],null]},[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$5\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$6\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$8\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}],[\"$\",\"$L9\",null,{}]]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"4\",{\"name\":\"application-name\",\"content\":\"Translator Demo\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"Translator,Transformers.js,Next.js,Tamagui\"}],[\"$\",\"meta\",\"7\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"8\",{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"9\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"10\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:url\",\"content\":\"https://hf.co/spaces/huuquyet/translator-tamagui/\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:site_name\",\"content\":\"Translator Demo\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:site\",\"content\":\"@HuuQuyetNg\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}]]\n2:null\n"])</script></body></html>
 
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/c07dfed9e589ce2b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-cb993d10a9392443.js"/><script src="/_next/static/chunks/fd9d1056-8fba21ecb5fa45b6.js" async=""></script><script src="/_next/static/chunks/190-b97855758bb23886.js" async=""></script><script src="/_next/static/chunks/main-app-8591d221f05263ff.js" async=""></script><script src="/_next/static/chunks/107-24dc2a03cc950c79.js" async=""></script><script src="/_next/static/chunks/app/layout-b185c3776a59f483.js" async=""></script><title>404: This page could not be found.</title><title>Translator demo app built with Transformers.js + Tamagui + Next.js</title><meta name="description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta name="application-name" content="Translator Demo"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><meta name="keywords" content="Translator,Transformers.js,Next.js,Tamagui"/><meta name="format-detection" content="telephone=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><meta property="og:title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta property="og:description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta property="og:url" content="https://hf.co/spaces/huuquyet/translator-tamagui/"/><meta property="og:site_name" content="Translator Demo"/><meta property="og:image" content="https://${process.env.vercel_url}/icon/share.png"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@HuuQuyetNg"/><meta name="twitter:title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta name="twitter:description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta name="twitter:image" content="https://${process.env.vercel_url}/icon/share.png"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script><style></style></head><body><span class="t_light is_inversed _dsp_contents"><span class=" t_light _dsp_contents is_Theme" style="color:var(--color)"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div></span></span><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--><script src="/_next/static/chunks/webpack-cb993d10a9392443.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/c07dfed9e589ce2b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[5751,[],\"\"]\n4:I[9275,[],\"\"]\n5:I[1343,[],\"\"]\n6:I[6657,[\"107\",\"static/chunks/107-24dc2a03cc950c79.js\",\"185\",\"static/chunks/app/layout-b185c3776a59f483.js\"],\"default\"]\nb:I[2944,[\"107\",\"static/chunks/107-24dc2a03cc950c79.js\",\"185\",\"static/chunks/app/layout-b185c3776a59f483.js\"],\"Analytics\"]\nd:I[6130,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\ne:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c07dfed9e589ce2b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L2\",null,{\"buildId\":\"2yIdB6J6TFtzbtR43oIj6\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/_not-found\",\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]]],null],null]},[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}]}],[\"$\",\"$Lb\",null,{}]]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$Lc\"],\"globalErrorComponent\":\"$d\",\"missingSlots\":\"$We\"}]]\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"4\",{\"name\":\"application-name\",\"content\":\"Translator Demo\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"Translator,Transformers.js,Next.js,Tamagui\"}],[\"$\",\"meta\",\"7\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"8\",{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"9\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"10\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:url\",\"content\":\"https://hf.co/spaces/huuquyet/translator-tamagui/\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:site_name\",\"content\":\"Translator Demo\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:site\",\"content\":\"@HuuQuyetNg\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}]]\n3:null\n"])</script></body></html><style></style>
_next/static/{UPicdb8faPBPzSbOulfRb β†’ 2yIdB6J6TFtzbtR43oIj6}/_buildManifest.js RENAMED
@@ -1 +1 @@
1
- self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-10ab295e4702c5ac.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
 
1
+ self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-1be831200e60c5c0.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
_next/static/{UPicdb8faPBPzSbOulfRb β†’ 2yIdB6J6TFtzbtR43oIj6}/_ssgManifest.js RENAMED
File without changes
_next/static/chunks/107-24dc2a03cc950c79.js ADDED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/190-b97855758bb23886.js ADDED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/40bfc07d-7d2b96f8f95c7906.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[309],{1139:function(e,s,t){t.d(s,{$Bv:function(){return ia},$Sz:function(){return a2},DcG:function(){return ic},ENH:function(){return ir},En$:function(){return is},Hqk:function(){return a8},IFL:function(){return iu},K2m:function(){return il},Kf0:function(){return a3},LdW:function(){return io},OjJ:function(){return a1},S2d:function(){return id},U$$:function(){return it},Zn:function(){return ii},hY6:function(){return i_},hZO:function(){return a5},lbf:function(){return a4},o$X:function(){return a0},t78:function(){return a7},tLj:function(){return ie},wiU:function(){return a9},z6E:function(){return a6}});var n=t(429),a=t(8551),i=t(4663),o=t(5858),r=t(7712),l=t(1180),c=t(5320);let{InferenceSession:d,Tensor:_,env:u}=l.ONNX,h={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5},m=new Map,p=new Map,f=new Map;async function g(e,s,t){let n=`onnx/${s}${t.quantized?"_quantized":""}.onnx`,a=await (0,i.st)(e,n,!0,t);try{return await d.create(a,{executionProviders:l.p})}catch(e){if(1===l.p.length&&"wasm"===l.p[0])throw e;return console.warn(e),console.warn("Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. "),await d.create(a,{executionProviders:["wasm"]})}}async function w(e,s){let t=function(e,s){let t=Object.create(null),n=[];for(let a of e.inputNames){let e=s[a];if(!(e instanceof r.es)){n.push(a);continue}t[a]=u.wasm.proxy?e.clone():e}if(n.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${n.join(", ")}.`);let a=Object.keys(s).length,i=e.inputNames.length;if(a>i){let t=Object.keys(s).filter(s=>!e.inputNames.includes(s));console.warn(`WARNING: Too many inputs were provided (${a} > ${i}). The following inputs will be ignored: "${t.join(", ")}".`)}return t}(e,s);try{let s=await e.run(t);return s=function e(s){for(let t in s)s[t]instanceof _?s[t]=new r.es(s[t]):"object"==typeof s[t]&&e(s[t]);return s}(s)}catch(e){throw console.error(`An error occurred during model execution: "${e}".`),console.error("Inputs given to model:",t),e}}function x(e,s){let t=e.config.pad_token_id??null,n=e.config.eos_token_id??null;(0,a.Wy)(n)&&(n=[n]);let i=-1!==s.indexOf(t),o=null===n||!n.includes(t);if(!i||!o)return(0,r.r6)(s);{let e=BigInt64Array.from(s.data.map(e=>e!=t));return new r.es("int64",e,s.dims)}}function y(e,s,t){if(!e.inputNames.includes("position_ids"))return;let n=new BigInt64Array(s.attention_mask.data.length);for(let e=0;e<s.attention_mask.dims[0];++e){let t=e*s.attention_mask.dims[1],a=BigInt(0);for(let e=0;e<s.attention_mask.dims[1];++e){let i=t+e;0n===s.attention_mask.data[i]?n[i]=BigInt(1):(n[i]=a,a+=s.attention_mask.data[i])}}s.position_ids=new r.es("int64",n,s.attention_mask.dims),t&&(s.position_ids=s.position_ids.slice(null,-1).unsqueeze_(-1))}function M(e){return new r.es("bool",[e],[1])}async function k(e,s){let{encoder_outputs:t,past_key_values:n}=s;t||(t=(await C(e,s)).last_hidden_state);let a={input_ids:s.decoder_input_ids,encoder_hidden_states:t},i=!!n;e.decoder_merged_session.inputNames.includes("use_cache_branch")&&(a.use_cache_branch=M(i)),e.decoder_merged_session.inputNames.includes("encoder_attention_mask")&&(a.encoder_attention_mask=s.attention_mask),y(e.decoder_merged_session,a,i),e.addPastKeyValues(a,n);let o=await w(e.decoder_merged_session,a);return new ih({logits:o.logits,past_key_values:n=e.getPastKeyValues(o,n),encoder_outputs:t,...e.getAttentions(o)})}function b(e,s,t,n){let a=[],i=0,o=e.requires_attention_mask??!0,l=t.decoder_input_ids??t.decoder_start_token_id??t.bos_token_id??t.eos_token_id;for(let t of(l instanceof r.es?l=l.tolist().flat():Array.isArray(l)||(l=[l]),s)){t.dims=[1,...t.dims];let s={inputs:t,encoder_outputs:null,prev_model_outputs:null,output_token_ids:l,done:!1,score:0,id:i++};o&&(s.attention_mask=x(e,t)),a.push(s)}return a}async function v(e,s){let t=e.main_input_name,n=s.output_token_ids;s.prev_model_outputs&&(n=n.slice(-1));let a={[t]:s.inputs,decoder_input_ids:function(e){if(e instanceof r.es)return e;if(0===e.length)throw Error("items must be non-empty");if(!Array.isArray(e[0]))return new r.es("int64",BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length]);if(e.some(s=>s.length!==e[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new r.es("int64",BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}(n),encoder_outputs:s.encoder_outputs,past_key_values:s.prev_model_outputs?.past_key_values};s.attention_mask&&(a.attention_mask=s.attention_mask);let i=await e.forward(a);return s.prev_model_outputs=i,s.encoder_outputs=i.encoder_outputs,i}function S(e,s){e.output_token_ids=[...e.output_token_ids,s]}async function C(e,s){let t=Object.create(null);for(let n of e.session.inputNames)t[n]=s[n];return e.session.inputNames.includes("token_type_ids")&&!t.token_type_ids&&(t.token_type_ids=new r.es("int64",new BigInt64Array(t.input_ids.data.length),t.input_ids.dims)),await w(e.session,t)}async function F(e,s){let{input_ids:t,past_key_values:n,attention_mask:a}=s,i={input_ids:t,attention_mask:a??x(e,t)},o=!!n;e.session.inputNames.includes("use_cache_branch")&&(i.use_cache_branch=M(o)),y(e.session,i,o),e.addPastKeyValues(i,n);let r=await w(e.session,i);return{logits:r.logits,past_key_values:n=e.getPastKeyValues(r,n)}}function L(e,s,t,n,a){let i=[],o=0;for(let t of s){let s,r=t.tolist().map(Number);t.dims=[1,...t.dims],a?(s=a[o]).dims=[1,...s.dims]:s=x(e,t);let l={input:t,model_input_ids:t,attention_mask:s,prev_model_outputs:null,output_token_ids:r,num_output_tokens:n,done:!1,score:0,id:o++};i.push(l)}return i}async function A(e,s){let t=new BigInt64Array(s.output_token_ids.length).fill(1n),n={input_ids:s.model_input_ids,attention_mask:new r.es("int64",t,[1,t.length]),past_key_values:s.prev_model_outputs?.past_key_values},a=await e.forward(n);return s.prev_model_outputs=a,a}function P(e,s){e.output_token_ids=[...e.output_token_ids,s],e.model_input_ids=new r.es("int64",[BigInt(s)],[1,1])}class E extends a.Ag{main_input_name="input_ids";constructor(e,s){super(),this.config=e,this.session=s;let t=f.get(this.constructor),n=m.get(t);this.can_generate=!1,this._runBeam=null,this._getStartBeams=null,this._updateBeam=null,this._forward=null,n===h.DecoderOnly?(this.can_generate=!0,this._runBeam=A,this._getStartBeams=L,this._updateBeam=P,this._forward=F):n===h.Seq2Seq||n===h.Vision2Seq?(this.can_generate=!0,this._runBeam=v,this._getStartBeams=b,this._updateBeam=S,this._forward=k):(h.EncoderDecoder,this._forward=C)}async dispose(){let e=[];for(let s of Object.keys(this)){let t=this[s];t instanceof d&&e.push(t.handler.dispose())}return await Promise.all(e)}static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:o=null,local_files_only:r=!1,revision:l="main",model_file_name:c=null}={}){let d,_={quantized:s,progress_callback:t,config:a,cache_dir:o,local_files_only:r,revision:l,model_file_name:c},u=f.get(this),p=m.get(u);return p===h.DecoderOnly?d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.Seq2Seq||p===h.Vision2Seq?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.MaskGeneration?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"vision_encoder",_),g(e,"prompt_encoder_mask_decoder",_)]):p===h.EncoderDecoder?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_)]):(p!==h.EncoderOnly&&console.warn(`Model type for '${u??a?.model_type}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`),d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"model",_)])),new this(...d)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}_get_logits_processor(e,s,t=null){let n=new o.Jm;if(null!==e.repetition_penalty&&1!==e.repetition_penalty&&n.push(new o.Jj(e.repetition_penalty)),null!==e.no_repeat_ngram_size&&e.no_repeat_ngram_size>0&&n.push(new o.jF(e.no_repeat_ngram_size)),null!==e.bad_words_ids&&n.push(new o.AE(e.bad_words_ids,e.eos_token_id)),null!==e.min_length&&null!==e.eos_token_id&&e.min_length>0&&n.push(new o.ez(e.min_length,e.eos_token_id)),null!==e.min_new_tokens&&null!==e.eos_token_id&&e.min_new_tokens>0&&n.push(new o.CJ(s,e.min_new_tokens,e.eos_token_id)),null!==e.forced_bos_token_id&&n.push(new o.C9(e.forced_bos_token_id)),null!==e.forced_eos_token_id&&n.push(new o.dZ(e.max_length,e.forced_eos_token_id)),null!==e.begin_suppress_tokens){let t=s>1||null===e.forced_bos_token_id?s:s+1;null!==e.forced_decoder_ids&&(t+=e.forced_decoder_ids[e.forced_decoder_ids.length-1][0]),n.push(new o.GU(e.begin_suppress_tokens,t))}return null!==e.forced_decoder_ids&&n.push(new o.E(e.forced_decoder_ids)),null!==t&&n.extend(t),n}_get_generation_config(e){let s=new o.aP(this.config);return"generation_config"in this&&Object.assign(s,this.generation_config),null!==e&&Object.assign(s,e),s}async generate(e,s=null,t=null,{inputs_attention_mask:n=null}={}){let i;if(!this.can_generate){let e=f.get(this.constructor),s=`The current model class (${e}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`,t=this.config.model_type,n=aT.get(t)??aB.get(t)??aL.get(t)??aq.get(t);throw n&&(s+=` Please use the following class instead: '${n[0]}'`),Error(s)}if(!(e instanceof r.es)&&!(0,a.fU)(e)&&!Array.isArray(e))throw Error(`\`inputs\` must be a Tensor, TypedArray, or Array, but is "${e.constructor.name}".`);if(this.config.is_encoder_decoder)i=0;else if(0===(i=e instanceof r.es?e.dims.at(-1):e.length))throw Error("Must supply a non-empty array of input token ids.");s=this._get_generation_config(s),t=t??new o.Jm,t=this._get_logits_processor(s,i,t);let l=s.eos_token_id;null===l||Array.isArray(l)||(l=[l]);let c=1,d=1+(s.max_new_tokens??1/0),_=Number.isInteger(s.max_length)&&(s.max_new_tokens??null)===null,u=o.Z4.getSampler(s),h=this.getStartBeams(e,s,c,n);for(;h.some(e=>!e.done)&&c<d;){let e=[];for(let n of h){if(n.done){e.push(n);continue}if(_&&n.output_token_ids.length>=s.max_length){n.done=!0,e.push(n);continue}let a=await this.runBeam(n);s.output_attentions&&this.addAttentionsToBeam(n,a),s.output_scores;let i=a.logits.slice(null,-1,null);for(let[s,a]of(t(n.output_token_ids,i),u(i))){let t={...n};this.updateBeam(t,s),t.score+=a,l&&l.includes(s)&&(t.done=!0),e.push(t)}}++c,h=(e=this.groupBeams(e).map(e=>e.sort((e,s)=>s.score-e.score).slice(0,s.num_beams))).flat(),s.callback_function&&s.callback_function(h)}let m=this.groupBeams(h),p=e=>m.map(t=>s.num_return_sequences>1?t.slice(0,s.num_return_sequences).map(s=>s[e]):[t[0][e]]).flat(),g=p("output_token_ids");return s.return_dict_in_generate?{sequences:g,decoder_attentions:p("decoder_attentions"),cross_attentions:p("cross_attentions")}:g}addAttentionsToBeam(e,s){if(this.config.is_encoder_decoder){if(!s.cross_attentions||0===s.cross_attentions.length)throw Error("`output_attentions` is true, but the model did not produce cross-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.cross_attentions||(e.cross_attentions=[]),e.cross_attentions.push(s.cross_attentions)}if(!s.decoder_attentions||0===s.decoder_attentions.length)throw Error("`output_attentions` is true, but the model did not produce decoder-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.decoder_attentions||(e.decoder_attentions=[]),e.decoder_attentions.push(s.decoder_attentions)}groupBeams(e){let s=Object.create(null);for(let t of e)void 0===s[t.id]?s[t.id]=[t]:s[t.id].push(t);return Object.values(s)}getPastKeyValues(e,s){let t=Object.create(null);for(let n in e)if(n.startsWith("present")){let a=n.replace("present","past_key_values");s&&n.includes("encoder")?t[a]=s[a]:t[a]=e[n]}return t}getAttentions(e){let s=Object.create(null);for(let t of["cross_attentions","decoder_attentions"]){let n=[];for(let s in e)s.startsWith(t)&&(n[s.split(".").pop()]=e[s]);s[t]=n}return s}addPastKeyValues(e,s){if(s)Object.assign(e,s);else if(this.config.is_encoder_decoder&&(this.add_encoder_pkv??!0)){let s=[1,this.num_encoder_heads,0,this.encoder_dim_kv],t=[1,this.num_decoder_heads,0,this.decoder_dim_kv];for(let n=0;n<this.num_decoder_layers;++n)e[`past_key_values.${n}.encoder.key`]=new r.es("float32",[],s),e[`past_key_values.${n}.encoder.value`]=new r.es("float32",[],s),e[`past_key_values.${n}.decoder.key`]=new r.es("float32",[],t),e[`past_key_values.${n}.decoder.value`]=new r.es("float32",[],t)}else if("falcon"===this.config.model_type){let s=[1*this.num_heads,0,this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key`]=new r.es("float32",[],s),e[`past_key_values.${t}.value`]=new r.es("float32",[],s)}else if(this.config.multi_query){let s=[1*this.num_heads,0,2*this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key_value`]=new r.es("float32",[],s)}else if("bloom"===this.config.model_type){let s=[1*this.num_heads,this.dim_kv,0],t=[1*this.num_heads,0,this.dim_kv];for(let n=0;n<this.num_layers;++n)e[`past_key_values.${n}.key`]=new r.es("float32",[],s),e[`past_key_values.${n}.value`]=new r.es("float32",[],t)}else{let s=[1,this.num_heads,0,this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key`]=new r.es("float32",[],s),e[`past_key_values.${t}.value`]=new r.es("float32",[],s)}}getStartBeams(e,s,t,n){return this._getStartBeams(this,e,s,t,n)}async runBeam(e){return await this._runBeam(this,e)}updateBeam(e,s){return this._updateBeam(e,s)}}class O{}class B extends E{}class T extends B{}class D extends B{async _call(e){return new iw(await super._call(e))}}class I extends B{async _call(e){return new im(await super._call(e))}}class q extends B{async _call(e){return new ig(await super._call(e))}}class N extends B{async _call(e){return new ix(await super._call(e))}}class G extends E{}class V extends G{}class z extends E{}class j extends z{}class $ extends z{async _call(e){return new iw(await super._call(e))}}class W extends z{async _call(e){return new im(await super._call(e))}}class R extends z{async _call(e){return new ig(await super._call(e))}}class Q extends z{async _call(e){return new ix(await super._call(e))}}class U extends E{}class X extends U{}class K extends U{async _call(e){return new iw(await super._call(e))}}class H extends U{async _call(e){return new im(await super._call(e))}}class J extends U{async _call(e){return new ig(await super._call(e))}}class Z extends U{async _call(e){return new ix(await super._call(e))}}class Y extends E{}class ee extends Y{}class es extends Y{async _call(e){return new iw(await super._call(e))}}class et extends Y{async _call(e){return new im(await super._call(e))}}class en extends Y{async _call(e){return new ig(await super._call(e))}}class ea extends Y{async _call(e){return new ix(await super._call(e))}}class ei extends E{}class eo extends ei{}class er extends ei{async _call(e){return new iw(await super._call(e))}}class el extends ei{async _call(e){return new im(await super._call(e))}}class ec extends ei{async _call(e){return new ig(await super._call(e))}}class ed extends ei{async _call(e){return new ix(await super._call(e))}}class e_ extends E{}class eu extends e_{}class eh extends e_{async _call(e){return new iw(await super._call(e))}}class em extends e_{async _call(e){return new im(await super._call(e))}}class ep extends e_{async _call(e){return new ig(await super._call(e))}}class ef extends e_{async _call(e){return new ix(await super._call(e))}}class eg extends E{}class ew extends eg{}class ex extends eg{async _call(e){return new iw(await super._call(e))}}class ey extends eg{async _call(e){return new im(await super._call(e))}}class eM extends eg{async _call(e){return new ig(await super._call(e))}}class ek extends eg{async _call(e){return new ix(await super._call(e))}}class eb extends E{}class ev extends eb{}class eS extends eb{async _call(e){return new im(await super._call(e))}}class eC extends eb{async _call(e){return new ig(await super._call(e))}}class eF extends eb{async _call(e){return new ix(await super._call(e))}}class eL extends eb{async _call(e){return new iw(await super._call(e))}}class eA extends E{}class eP extends eA{}class eE extends eA{async _call(e){return new iw(await super._call(e))}}class eO extends eA{async _call(e){return new im(await super._call(e))}}class eB extends eA{async _call(e){return new ig(await super._call(e))}}class eT extends E{}class eD extends eT{}class eI extends eT{async _call(e){return new iw(await super._call(e))}}class eq extends eT{async _call(e){return new im(await super._call(e))}}class eN extends eT{async _call(e){return new ix(await super._call(e))}}class eG extends E{}class eV extends eG{}class ez extends eG{async _call(e){return new iw(await super._call(e))}}class ej extends eG{async _call(e){return new im(await super._call(e))}}class e$ extends eG{async _call(e){return new ig(await super._call(e))}}class eW extends eG{async _call(e){return new ix(await super._call(e))}}class eR extends E{}class eQ extends eR{}class eU extends eR{async _call(e){return new iw(await super._call(e))}}class eX extends eR{async _call(e){return new im(await super._call(e))}}class eK extends eR{async _call(e){return new ix(await super._call(e))}}class eH extends E{}class eJ extends eH{}class eZ extends eH{async _call(e){return new im(await super._call(e))}}class eY extends eH{async _call(e){return new ix(await super._call(e))}}class e2 extends eH{async _call(e){return new iw(await super._call(e))}}class e0 extends E{}class e1 extends e0{}class e3 extends e0{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class e5 extends E{}class e4 extends e5{}class e6 extends e5{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class e8 extends E{}class e7 extends e8{}class e9 extends e8{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class se extends E{}class ss extends se{}class st extends se{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sn extends se{async _call(e){return new im(await super._call(e))}}class sa extends E{}class si extends sa{}class so extends sa{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sr extends sa{async _call(e){return new im(await super._call(e))}}class sl extends sa{constructor(e,s,t){super(e,s),this.generation_config=t,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sc extends E{}class sd extends sc{}class s_ extends sc{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class su extends E{}class sh extends su{}class sm extends su{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sp extends E{}class sf extends sp{}class sg extends sp{async _call(e){return new iw(await super._call(e))}}class sw extends sp{async _call(e){return new im(await super._call(e))}}class sx extends sp{async _call(e){return new ig(await super._call(e))}}class sy extends sp{async _call(e){return new ix(await super._call(e))}}class sM extends E{}class sk extends sM{}class sb extends sM{async _call(e){return new iw(await super._call(e))}}class sv extends sM{async _call(e){return new im(await super._call(e))}}class sS extends sM{async _call(e){return new ig(await super._call(e))}}class sC extends sM{async _call(e){return new ix(await super._call(e))}}class sF extends E{}class sL extends sF{}class sA extends sF{async _call(e){return new iw(await super._call(e))}}class sP extends sF{async _call(e){return new im(await super._call(e))}}class sE extends sF{async _call(e){return new ig(await super._call(e))}}class sO extends sF{async _call(e){return new ix(await super._call(e))}}class sB extends E{}class sT extends sB{}class sD extends sB{}class sI extends E{}class sq extends sI{}class sN extends sI{requires_attention_mask=!1;main_input_name="input_features";constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}async generate(e,s=null,t=null){if(s=this._get_generation_config(s),s.return_timestamps??=!1,s.return_timestamps&&(t=[new o.Pg(s)]),s.return_token_timestamps&&(s.output_attentions=!0,s.return_dict_in_generate=!0,"translate"===s.task&&console.warn("Token-level timestamps may not be reliable for task 'translate'."),!s.alignment_heads))throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");let n=await super.generate(e,s,t);return s.return_token_timestamps&&s.alignment_heads&&(n.token_timestamps=this._extract_token_timestamps(n,s.alignment_heads,s.num_frames)),n}_extract_token_timestamps(e,s,t=null,n=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");let i=this.config.median_filter_width;void 0===i&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let o=e.cross_attentions.map(e=>{let n=Array.from({length:this.config.decoder_layers},(s,t)=>(0,r.d3)(e.map(e=>e[t]),2)),a=(0,r.kn)(s.map(([e,s])=>t?n[e].slice(null,s,null,[0,t]):n[e].slice(null,s)));a=a.transpose(1,0,2,3);let[o,l]=(0,r.f3)(a,-2,0,!0),d=a.clone();for(let e=0;e<d.dims[0];++e){let s=d[e];for(let t=0;t<s.dims[0];++t){let n=s[t],a=o[e][t][0],r=l[e][t][0];for(let e=0;e<n.dims[0];++e){let s=n[e];for(let e=0;e<s.data.length;++e)s.data[e]=(s.data[e]-r.data[e])/a.data[e];s.data.set((0,c.qCb)(s.data,i))}}}return(0,r.J6)(d,1)}),l=[e.sequences.length,e.sequences[0].length],d=new r.es("float32",new Float32Array(l[0]*l[1]),l);for(let e=0;e<l[0];++e){let s=o[e].neg().squeeze_(0),[t,i]=(0,r.Ks)(s),l=Array.from({length:t.length-1},(e,s)=>t[s+1]-t[s]),c=(0,a.eG)([1],l).map(e=>!!e),_=[];for(let e=0;e<c.length;++e)c[e]&&_.push(i[e]*n);d[e].data.set(_,1)}return d}}class sG extends E{main_input_name="pixel_values";constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n;let a=this.config.encoder,i=this.config.decoder,o=a.model_type;(aS.get(o)??aC.get(o))||console.warn(`Model type for encoder '${o}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`);let r=aT.get(i.model_type);if(!r)throw Error(`Unable to construct \`VisionEncoderDecoder\` due to unsupported decoder: "${this.config.decoder.model_type}"`);let l=new r[1](i,t,n);this.add_encoder_pkv="num_decoder_layers"in l,this.add_encoder_pkv?(this.num_decoder_layers=l.num_decoder_layers,this.num_decoder_heads=l.num_decoder_heads,this.decoder_dim_kv=l.decoder_dim_kv,this.num_encoder_layers=l.num_encoder_layers,this.num_encoder_heads=l.num_encoder_heads,this.encoder_dim_kv=l.encoder_dim_kv):(this.num_layers=l.num_layers,this.num_heads=l.num_heads,this.dim_kv=l.dim_kv)}}class sV extends E{}class sz extends sV{}class sj extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class s$ extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="vision_model",super.from_pretrained(e,s)}}class sW extends E{}class sR extends sW{}class sQ extends sW{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class sU extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="vision_model",super.from_pretrained(e,s)}}class sX extends E{}class sK extends sX{}class sH extends E{}class sJ extends sH{}class sZ extends sH{}class sY extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class s2 extends sY{}class s0 extends sY{}class s1 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_heads,this.num_layers=this.config.num_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class s3 extends s1{}class s5 extends s1{}class s4 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class s6 extends s4{}class s8 extends s4{}class s7 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class s9 extends s7{}class te extends s7{}class ts extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class tt extends ts{}class tn extends ts{}class ta extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class ti extends ta{}class to extends ta{}class tr extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads??this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class tl extends tr{}class tc extends tr{}class td extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads??this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class t_ extends td{}class tu extends td{}class th extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class tm extends th{}class tp extends th{}class tf extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.hidden_size/this.num_heads}}class tg extends tf{}class tw extends tf{}class tx extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_heads,this.num_layers=this.config.n_layers,this.dim_kv=this.config.d_model/this.num_heads}}class ty extends tx{}class tM extends tx{}class tk extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class tb extends tk{}class tv extends tk{}class tS extends E{}class tC extends tS{}class tF extends tS{async _call(e){return new im(await super._call(e))}}class tL extends E{}class tA extends tL{async _call(e){return new iM(await super._call(e))}}class tP extends E{}class tE extends tP{}class tO extends tP{async _call(e){return new im(await super._call(e))}}class tB extends E{}class tT extends tB{}class tD extends tB{}class tI extends E{}class tq extends tI{}class tN extends tI{}class tG extends E{}class tV extends tG{}class tz extends tG{async _call(e){return new im(await super._call(e))}}class tj extends E{}class t$ extends tj{}class tW extends tj{async _call(e){return new tQ(await super._call(e))}}class tR extends tj{async _call(e){return new tU(await super._call(e))}}class tQ extends O{constructor({logits:e,pred_boxes:s}){super(),this.logits=e,this.pred_boxes=s}}class tU extends O{constructor({logits:e,pred_boxes:s,pred_masks:t}){super(),this.logits=e,this.pred_boxes=s,this.pred_masks=t}}class tX extends E{}class tK extends tX{}class tH extends tX{async _call(e){return new tJ(await super._call(e))}}class tJ extends tQ{}class tZ extends E{}class tY extends tZ{}class t2 extends tZ{async _call(e){return new im(await super._call(e))}}class t0 extends E{}class t1 extends t0{}class t3 extends t0{async _call(e){return new im(await super._call(e))}}class t5 extends E{}class t4 extends t5{}class t6 extends t5{async _call(e){return new im(await super._call(e))}}class t8 extends E{}class t7 extends t8{}class t9 extends t8{}class ne extends E{}class ns extends ne{}class nt extends ne{}class nn extends E{}class na extends nn{}class ni extends E{}class no extends ni{}class nr extends ni{}class nl extends E{}class nc extends nl{}class nd extends E{}class n_ extends nd{}class nu extends nd{async _call(e){return new im(await super._call(e))}}class nh extends E{}class nm extends nh{}class np extends nh{async _call(e){return new im(await super._call(e))}}class nf extends E{}class ng extends nf{}class nw extends nf{async _call(e){return new im(await super._call(e))}}class nx extends E{}class ny extends nx{}class nM extends nx{async _call(e){return new nk(await super._call(e))}}class nk extends O{constructor({logits:e,pred_boxes:s}){super(),this.logits=e,this.pred_boxes=s}}class nb extends E{}class nv extends nb{constructor(e,s,t){super(e,s),this.prompt_encoder_mask_decoder=t}async get_image_embeddings({pixel_values:e}){return await C(this,{pixel_values:e})}async forward(e){if(e.image_embeddings&&e.image_positional_embeddings||(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels){let s=e.input_points.dims.slice(0,-1),t=s.reduce((e,s)=>e*s,1);e.input_labels=new r.es("int64",new BigInt64Array(t).fill(1n),s)}return await w(this.prompt_encoder_mask_decoder,{input_points:e.input_points,input_labels:e.input_labels,image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings})}async _call(e){return new nS(await super._call(e))}}class nS extends O{constructor({iou_scores:e,pred_masks:s}){super(),this.iou_scores=e,this.pred_masks=s}}class nC extends E{}class nF extends nC{}class nL extends nC{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nA extends E{}class nP extends nA{}class nE extends nA{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nO extends E{}class nB extends nO{}class nT extends nO{async _call(e){return new iy(await super._call(e))}}class nD extends nO{async _call(e){return new im(await super._call(e))}}class nI extends nO{async _call(e){return new ig(await super._call(e))}}class nq extends E{}class nN extends nq{}class nG extends nq{async _call(e){return new iy(await super._call(e))}}class nV extends nq{async _call(e){return new im(await super._call(e))}}class nz extends E{}class nj extends nz{}class n$ extends nz{async _call(e){return new iy(await super._call(e))}}class nW extends nz{async _call(e){return new im(await super._call(e))}}class nR extends nz{async _call(e){return new ig(await super._call(e))}}class nQ extends E{}class nU extends nQ{}class nX extends nQ{async _call(e){return new iy(await super._call(e))}}class nK extends nQ{async _call(e){return new im(await super._call(e))}}class nH extends nO{}class nJ extends nO{async _call(e){return new iy(await super._call(e))}}class nZ extends nO{async _call(e){return new im(await super._call(e))}}class nY extends E{}class n2 extends nY{}class n0 extends nY{async _call(e){return new iy(await super._call(e))}}class n1 extends nY{async _call(e){return new im(await super._call(e))}}class n3 extends nY{async _call(e){return new ip(await super._call(e))}}class n5 extends nY{async _call(e){return new ig(await super._call(e))}}class n4 extends E{}class n6 extends n4{}class n8 extends n4{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.hidden_size/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.hidden_size/this.num_encoder_heads}async generate_speech(e,s,{threshold:t=.5,minlenratio:n=0,maxlenratio:a=20,vocoder:i=null}={}){let{encoder_outputs:o,encoder_attention_mask:l}=await C(this,{input_ids:e}),c=o.dims[1]/this.config.reduction_factor,d=Math.floor(c*a),_=Math.floor(c*n),u=this.config.num_mel_bins,h=[],m=null,p=null,f=0;for(;;){++f;let e={use_cache_branch:M(!!p),output_sequence:p?p.output_sequence_out:new r.es("float32",new Float32Array(u),[1,1,u]),encoder_attention_mask:l,speaker_embeddings:s,encoder_hidden_states:o};this.addPastKeyValues(e,m),p=await w(this.decoder_merged_session,e),m=this.getPastKeyValues(p,m);let{prob:n,spectrum:a}=p;if(h.push(a),f>=_&&(Array.from(n.data).filter(e=>e>=t).length>0||f>=d))break}let g=(0,r.d3)(h),{waveform:x}=await w(i.session,{spectrogram:g});return{spectrogram:g,waveform:x}}}class n7 extends E{main_input_name="spectrogram"}class n9 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_encoder_layers=this.num_decoder_layers=this.config.decoder_layers,this.num_encoder_heads=this.num_decoder_heads=this.config.decoder_attention_heads,this.encoder_dim_kv=this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads}}class ae extends n9{}class as extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class at extends as{}class an extends as{}class aa extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class ai extends aa{}class ao extends aa{}class ar extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class al extends ar{}class ac extends ar{}class ad extends E{}class a_ extends ad{}class au extends ad{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class ah extends ad{static async from_pretrained(e,s={}){return s.model_file_name??="audio_model",super.from_pretrained(e,s)}}class am extends E{}class ap extends am{async _call(e){return new ik(await super._call(e))}}class af extends E{}class ag extends af{}class aw extends af{}class ax extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class ay extends ax{}class aM extends E{}class ak extends aM{}class ab extends aM{async _call(e){return new im(await super._call(e))}}class av{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:i=null,local_files_only:o=!1,revision:r="main",model_file_name:l=null}={}){let c={quantized:s,progress_callback:t,config:a,cache_dir:i,local_files_only:o,revision:r,model_file_name:l};if(a=await n.z.from_pretrained(e,c),c.config||(c.config=a),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);for(let s of this.MODEL_CLASS_MAPPINGS){let t=s.get(a.model_type);if(t)return await t[1].from_pretrained(e,c)}if(this.BASE_IF_FAIL)return console.warn(`Unknown model class "${a.model_type}", attempting to construct from base class.`),await E.from_pretrained(e,c);throw Error(`Unsupported model type: ${a.model_type}`)}}let aS=new Map([["bert",["BertModel",T]],["nomic_bert",["NomicBertModel",V]],["roformer",["RoFormerModel",j]],["electra",["ElectraModel",ee]],["esm",["EsmModel",eP]],["convbert",["ConvBertModel",X]],["camembert",["CamembertModel",eo]],["deberta",["DebertaModel",eu]],["deberta-v2",["DebertaV2Model",ew]],["mpnet",["MPNetModel",eV]],["albert",["AlbertModel",eJ]],["distilbert",["DistilBertModel",ev]],["roberta",["RobertaModel",sf]],["xlm",["XLMModel",sk]],["xlm-roberta",["XLMRobertaModel",sL]],["clap",["ClapModel",a_]],["clip",["CLIPModel",sz]],["clipseg",["CLIPSegModel",sJ]],["chinese_clip",["ChineseCLIPModel",sK]],["siglip",["SiglipModel",sR]],["mobilebert",["MobileBertModel",eD]],["squeezebert",["SqueezeBertModel",eQ]],["wav2vec2",["Wav2Vec2Model",nB]],["wav2vec2-bert",["Wav2Vec2BertModel",nU]],["unispeech",["UniSpeechModel",nN]],["unispeech-sat",["UniSpeechSatModel",nj]],["hubert",["HubertModel",nH]],["wavlm",["WavLMModel",n2]],["audio-spectrogram-transformer",["ASTModel",sT]],["vits",["VitsModel",ap]],["detr",["DetrModel",t$]],["table-transformer",["TableTransformerModel",tK]],["vit",["ViTModel",tC]],["mobilevit",["MobileViTModel",tE]],["owlvit",["OwlViTModel",tT]],["owlv2",["Owlv2Model",tq]],["beit",["BeitModel",tV]],["deit",["DeiTModel",tY]],["convnext",["ConvNextModel",n_]],["convnextv2",["ConvNextV2Model",nm]],["dinov2",["Dinov2Model",ng]],["resnet",["ResNetModel",t1]],["swin",["SwinModel",t4]],["swin2sr",["Swin2SRModel",t7]],["donut-swin",["DonutSwinModel",nc]],["yolos",["YolosModel",ny]],["dpt",["DPTModel",ns]],["glpn",["GLPNModel",no]],["hifigan",["SpeechT5HifiGan",n7]],["efficientnet",["EfficientNetModel",ak]]]),aC=new Map([["t5",["T5Model",e1]],["longt5",["LongT5Model",e4]],["mt5",["MT5Model",e7]],["bart",["BartModel",ss]],["mbart",["MBartModel",si]],["marian",["MarianModel",nF]],["whisper",["WhisperModel",sq]],["m2m_100",["M2M100Model",nP]],["blenderbot",["BlenderbotModel",sd]],["blenderbot-small",["BlenderbotSmallModel",sh]]]),aF=new Map([["bloom",["BloomModel",tg]],["gpt2",["GPT2Model",s2]],["gptj",["GPTJModel",s9]],["gpt_bigcode",["GPTBigCodeModel",tt]],["gpt_neo",["GPTNeoModel",s3]],["gpt_neox",["GPTNeoXModel",s6]],["codegen",["CodeGenModel",ti]],["llama",["LlamaModel",tl]],["qwen2",["Qwen2Model",t_]],["phi",["PhiModel",tm]],["mpt",["MptModel",ty]],["opt",["OPTModel",tb]],["mistral",["MistralModel",at]],["starcoder2",["Starcoder2Model",ai]],["falcon",["FalconModel",al]]]),aL=new Map([["speecht5",["SpeechT5ForSpeechToText",n6]],["whisper",["WhisperForConditionalGeneration",sN]]]),aA=new Map([["speecht5",["SpeechT5ForTextToSpeech",n8]]]),aP=new Map([["vits",["VitsModel",ap]]]),aE=new Map([["bert",["BertForSequenceClassification",I]],["roformer",["RoFormerForSequenceClassification",W]],["electra",["ElectraForSequenceClassification",et]],["esm",["EsmForSequenceClassification",eO]],["convbert",["ConvBertForSequenceClassification",H]],["camembert",["CamembertForSequenceClassification",el]],["deberta",["DebertaForSequenceClassification",em]],["deberta-v2",["DebertaV2ForSequenceClassification",ey]],["mpnet",["MPNetForSequenceClassification",ej]],["albert",["AlbertForSequenceClassification",eZ]],["distilbert",["DistilBertForSequenceClassification",eS]],["roberta",["RobertaForSequenceClassification",sw]],["xlm",["XLMForSequenceClassification",sv]],["xlm-roberta",["XLMRobertaForSequenceClassification",sP]],["bart",["BartForSequenceClassification",sn]],["mbart",["MBartForSequenceClassification",sr]],["mobilebert",["MobileBertForSequenceClassification",eq]],["squeezebert",["SqueezeBertForSequenceClassification",eX]]]),aO=new Map([["bert",["BertForTokenClassification",q]],["roformer",["RoFormerForTokenClassification",R]],["electra",["ElectraForTokenClassification",en]],["esm",["EsmForTokenClassification",eB]],["convbert",["ConvBertForTokenClassification",J]],["camembert",["CamembertForTokenClassification",ec]],["deberta",["DebertaForTokenClassification",ep]],["deberta-v2",["DebertaV2ForTokenClassification",eM]],["mpnet",["MPNetForTokenClassification",e$]],["distilbert",["DistilBertForTokenClassification",eC]],["roberta",["RobertaForTokenClassification",sx]],["xlm",["XLMForTokenClassification",sS]],["xlm-roberta",["XLMRobertaForTokenClassification",sE]]]),aB=new Map([["t5",["T5ForConditionalGeneration",e3]],["longt5",["LongT5ForConditionalGeneration",e6]],["mt5",["MT5ForConditionalGeneration",e9]],["bart",["BartForConditionalGeneration",st]],["mbart",["MBartForConditionalGeneration",so]],["marian",["MarianMTModel",nL]],["m2m_100",["M2M100ForConditionalGeneration",nE]],["blenderbot",["BlenderbotForConditionalGeneration",s_]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",sm]]]),aT=new Map([["bloom",["BloomForCausalLM",tw]],["gpt2",["GPT2LMHeadModel",s0]],["gptj",["GPTJForCausalLM",te]],["gpt_bigcode",["GPTBigCodeForCausalLM",tn]],["gpt_neo",["GPTNeoForCausalLM",s5]],["gpt_neox",["GPTNeoXForCausalLM",s8]],["codegen",["CodeGenForCausalLM",to]],["llama",["LlamaForCausalLM",tc]],["qwen2",["Qwen2ForCausalLM",tu]],["phi",["PhiForCausalLM",tp]],["mpt",["MptForCausalLM",tM]],["opt",["OPTForCausalLM",tv]],["mbart",["MBartForCausalLM",sl]],["mistral",["MistralForCausalLM",an]],["starcoder2",["Starcoder2ForCausalLM",ao]],["falcon",["FalconForCausalLM",ac]],["trocr",["TrOCRForCausalLM",ae]],["stablelm",["StableLmForCausalLM",ay]]]),aD=new Map([["bert",["BertForMaskedLM",D]],["roformer",["RoFormerForMaskedLM",$]],["electra",["ElectraForMaskedLM",es]],["esm",["EsmForMaskedLM",eE]],["convbert",["ConvBertForMaskedLM",K]],["camembert",["CamembertForMaskedLM",er]],["deberta",["DebertaForMaskedLM",eh]],["deberta-v2",["DebertaV2ForMaskedLM",ex]],["mpnet",["MPNetForMaskedLM",ez]],["albert",["AlbertForMaskedLM",e2]],["distilbert",["DistilBertForMaskedLM",eL]],["roberta",["RobertaForMaskedLM",sg]],["xlm",["XLMWithLMHeadModel",sb]],["xlm-roberta",["XLMRobertaForMaskedLM",sA]],["mobilebert",["MobileBertForMaskedLM",eI]],["squeezebert",["SqueezeBertForMaskedLM",eU]]]),aI=new Map([["bert",["BertForQuestionAnswering",N]],["roformer",["RoFormerForQuestionAnswering",Q]],["electra",["ElectraForQuestionAnswering",ea]],["convbert",["ConvBertForQuestionAnswering",Z]],["camembert",["CamembertForQuestionAnswering",ed]],["deberta",["DebertaForQuestionAnswering",ef]],["deberta-v2",["DebertaV2ForQuestionAnswering",ek]],["mpnet",["MPNetForQuestionAnswering",eW]],["albert",["AlbertForQuestionAnswering",eY]],["distilbert",["DistilBertForQuestionAnswering",eF]],["roberta",["RobertaForQuestionAnswering",sy]],["xlm",["XLMForQuestionAnswering",sC]],["xlm-roberta",["XLMRobertaForQuestionAnswering",sO]],["mobilebert",["MobileBertForQuestionAnswering",eN]],["squeezebert",["SqueezeBertForQuestionAnswering",eK]]]),aq=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aN=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aG=new Map([["vit",["ViTForImageClassification",tF]],["mobilevit",["MobileViTForImageClassification",tO]],["beit",["BeitForImageClassification",tz]],["deit",["DeiTForImageClassification",t2]],["convnext",["ConvNextForImageClassification",nu]],["convnextv2",["ConvNextV2ForImageClassification",np]],["dinov2",["Dinov2ForImageClassification",nw]],["resnet",["ResNetForImageClassification",t3]],["swin",["SwinForImageClassification",t6]],["segformer",["SegformerForImageClassification",ag]],["efficientnet",["EfficientNetForImageClassification",ab]]]),aV=new Map([["detr",["DetrForObjectDetection",tW]],["table-transformer",["TableTransformerForObjectDetection",tH]],["yolos",["YolosForObjectDetection",nM]]]),az=new Map([["owlvit",["OwlViTForObjectDetection",tD]],["owlv2",["Owlv2ForObjectDetection",tN]]]),aj=new Map([["detr",["DetrForSegmentation",tR]],["clipseg",["CLIPSegForImageSegmentation",sZ]]]),a$=new Map([["segformer",["SegformerForSemanticSegmentation",aw]]]),aW=new Map([["sam",["SamModel",nv]]]),aR=new Map([["wav2vec2",["Wav2Vec2ForCTC",nT]],["wav2vec2-bert",["Wav2Vec2BertForCTC",nX]],["unispeech",["UniSpeechForCTC",nG]],["unispeech-sat",["UniSpeechSatForCTC",n$]],["wavlm",["WavLMForCTC",n0]],["hubert",["HubertForCTC",nJ]]]),aQ=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",nD]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",nK]],["unispeech",["UniSpeechForSequenceClassification",nV]],["unispeech-sat",["UniSpeechSatForSequenceClassification",nW]],["wavlm",["WavLMForSequenceClassification",n1]],["hubert",["HubertForSequenceClassification",nZ]],["audio-spectrogram-transformer",["ASTForAudioClassification",sD]]]),aU=new Map([["wavlm",["WavLMForXVector",n3]]]),aX=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",nR]],["wavlm",["WavLMForAudioFrameClassification",n5]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",nI]]]),aK=new Map([["vitmatte",["VitMatteForImageMatting",tA]]]),aH=new Map([["swin2sr",["Swin2SRForImageSuperResolution",t9]]]),aJ=new Map([["dpt",["DPTForDepthEstimation",nt]],["depth_anything",["DepthAnythingForDepthEstimation",na]],["glpn",["GLPNForDepthEstimation",nr]]]),aZ=new Map([["clip",["CLIPVisionModelWithProjection",s$]],["siglip",["SiglipVisionModel",sU]]]),aY=[[aS,h.EncoderOnly],[aC,h.EncoderDecoder],[aF,h.DecoderOnly],[aE,h.EncoderOnly],[aO,h.EncoderOnly],[aB,h.Seq2Seq],[aL,h.Seq2Seq],[aT,h.DecoderOnly],[aD,h.EncoderOnly],[aI,h.EncoderOnly],[aq,h.Vision2Seq],[aG,h.EncoderOnly],[aj,h.EncoderOnly],[a$,h.EncoderOnly],[aK,h.EncoderOnly],[aH,h.EncoderOnly],[aJ,h.EncoderOnly],[aV,h.EncoderOnly],[az,h.EncoderOnly],[aW,h.MaskGeneration],[aR,h.EncoderOnly],[aQ,h.EncoderOnly],[aA,h.Seq2Seq],[aP,h.EncoderOnly],[aU,h.EncoderOnly],[aX,h.EncoderOnly],[aZ,h.EncoderOnly]];for(let[e,s]of aY)for(let[t,n]of e.values())m.set(t,s),f.set(n,t),p.set(t,n);for(let[e,s,t]of[["CLIPTextModelWithProjection",sj,h.EncoderOnly],["SiglipTextModel",sQ,h.EncoderOnly],["ClapTextModelWithProjection",au,h.EncoderOnly],["ClapAudioModelWithProjection",ah,h.EncoderOnly]])m.set(e,t),f.set(s,e),p.set(e,s);class a2 extends av{static MODEL_CLASS_MAPPINGS=aY.map(e=>e[0]);static BASE_IF_FAIL=!0}class a0 extends av{static MODEL_CLASS_MAPPINGS=[aE]}class a1 extends av{static MODEL_CLASS_MAPPINGS=[aO]}class a3 extends av{static MODEL_CLASS_MAPPINGS=[aB]}class a5 extends av{static MODEL_CLASS_MAPPINGS=[aL]}class a4 extends av{static MODEL_CLASS_MAPPINGS=[aA]}class a6 extends av{static MODEL_CLASS_MAPPINGS=[aP]}class a8 extends av{static MODEL_CLASS_MAPPINGS=[aT]}class a7 extends av{static MODEL_CLASS_MAPPINGS=[aD]}class a9 extends av{static MODEL_CLASS_MAPPINGS=[aI]}class ie extends av{static MODEL_CLASS_MAPPINGS=[aq]}class is extends av{static MODEL_CLASS_MAPPINGS=[aG]}class it extends av{static MODEL_CLASS_MAPPINGS=[aj]}class ia extends av{static MODEL_CLASS_MAPPINGS=[a$]}class ii extends av{static MODEL_CLASS_MAPPINGS=[aV]}class io extends av{static MODEL_CLASS_MAPPINGS=[az]}class ir extends av{static MODEL_CLASS_MAPPINGS=[aR]}class il extends av{static MODEL_CLASS_MAPPINGS=[aQ]}class ic extends av{static MODEL_CLASS_MAPPINGS=[aN]}class id extends av{static MODEL_CLASS_MAPPINGS=[aH]}class i_ extends av{static MODEL_CLASS_MAPPINGS=[aJ]}class iu extends av{static MODEL_CLASS_MAPPINGS=[aZ]}class ih extends O{constructor({logits:e,past_key_values:s,encoder_outputs:t,decoder_attentions:n=null,cross_attentions:a=null}){super(),this.logits=e,this.past_key_values=s,this.encoder_outputs=t,this.decoder_attentions=n,this.cross_attentions=a}}class im extends O{constructor({logits:e}){super(),this.logits=e}}class ip extends O{constructor({logits:e,embeddings:s}){super(),this.logits=e,this.embeddings=s}}class ig extends O{constructor({logits:e}){super(),this.logits=e}}class iw extends O{constructor({logits:e}){super(),this.logits=e}}class ix extends O{constructor({start_logits:e,end_logits:s}){super(),this.start_logits=e,this.end_logits=s}}class iy extends O{constructor({logits:e}){super(),this.logits=e}}class iM extends O{constructor({alphas:e}){super(),this.alphas=e}}class ik extends O{constructor({waveform:e,spectrogram:s}){super(),this.waveform=e,this.spectrogram=s}}}}]);
 
 
_next/static/chunks/528-278ce8f7ba7eac7e.js DELETED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/{5f09d46c-d4955f71949979a4.js β†’ 590caa2a.699039c37022246b.js} RENAMED
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[138],{7952:function(e,t,s){s.d(t,{t2:function(){return e9}});var n=s(8551),i=s(4663),r=s(9e3),o=s(7712),a=s(2012),l=s(4825);async function c(e,t){let s=await Promise.all([(0,i.yM)(e,"tokenizer.json",!0,t),(0,i.yM)(e,"tokenizer_config.json",!0,t)]);return null!==t.legacy&&(s[1].legacy=t.legacy),s}function h(e,t=!0){if(void 0!==e.Regex){let t=e.Regex.replace(/\\([#&~])/g,"$1");for(let[e,s]of g)t=t.replaceAll(e,s);return RegExp(t,"gu")}if(void 0===e.String)return console.warn("Unknown pattern type:",e),null;{let s=(0,n.hr)(e.String);return RegExp(t?s:`(${s})`,"gu")}}function u(e){return new Map(Object.entries(e))}function d(e){let t=e.dims;switch(t.length){case 1:return e.tolist();case 2:if(1!==t[0])throw Error("Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.");return e.tolist()[0];default:throw Error(`Expected tensor to have 1-2 dimensions, got ${t.length}.`)}}function _(e){return e.replace(/ \./g,".").replace(/ \?/g,"?").replace(/ \!/g,"!").replace(/ ,/g,",").replace(/ \' /g,"'").replace(/ n\'t/g,"n't").replace(/ \'m/g,"'m").replace(/ \'s/g,"'s").replace(/ \'ve/g,"'ve").replace(/ \'re/g,"'re")}function p(e){return e.replace(/[\u0300-\u036f]/g,"")}let f="\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E",g=new Map([["(?i:'s|'t|'re|'ve|'m|'ll|'d)","(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))"]]);class m{constructor(e){this.content=e.content,this.id=e.id,this.single_word=e.single_word??!1,this.lstrip=e.lstrip??!1,this.rstrip=e.rstrip??!1,this.special=e.special??!1,this.normalized=e.normalized??null}}class k extends n.Ag{constructor(e){super(),this.config=e,this.vocab=[],this.tokens_to_ids=new Map,this.unk_token_id=void 0,this.unk_token=void 0,this.end_of_word_suffix=void 0,this.fuse_unk=this.config.fuse_unk??!1}static fromConfig(e,...t){switch(e.type){case"WordPiece":return new x(e);case"Unigram":return new w(e,...t);case"BPE":return new v(e);default:if(e.vocab)return new z(e,...t);throw Error(`Unknown TokenizerModel type: ${e.type}`)}}_call(e){let t=this.encode(e);return this.fuse_unk&&(t=function(e,t,s){let n=[],i=0;for(;i<e.length;){if(n.push(e[i]),(s.get(e[i])??t)!==t){++i;continue}for(;i<e.length&&(s.get(e[i])??t)===t;)++i}return n}(t,this.unk_token_id,this.tokens_to_ids)),t}encode(e){throw Error("encode should be implemented in subclass.")}convert_tokens_to_ids(e){return e.map(e=>this.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class x extends k{constructor(e){for(let[t,s]of(super(e),this.tokens_to_ids=u(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[s]=t}encode(e){let t=[];for(let s of e){let e=[...s];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let n=!1,i=0,r=[];for(;i<e.length;){let t=e.length,s=null;for(;i<t;){let n=e.slice(i,t).join("");if(i>0&&(n=this.config.continuing_subword_prefix+n),this.tokens_to_ids.has(n)){s=n;break}--t}if(null===s){n=!0;break}r.push(s),i=t}n?t.push(this.unk_token):t.push(...r)}return t}}class w extends k{constructor(e,t){super(e);let s=e.vocab.length;this.vocab=Array(s),this.scores=Array(s);for(let t=0;t<s;++t){let s=e.vocab[t];this.vocab[t]=s[0],this.scores[t]=s[1]}this.unk_token_id=e.unk_id,this.unk_token=this.vocab[e.unk_id],this.tokens_to_ids=new Map(this.vocab.map((e,t)=>[e,t])),this.bosToken=" ",this.bosTokenId=this.tokens_to_ids.get(this.bosToken),this.eosToken=t.eos_token,this.eosTokenId=this.tokens_to_ids.get(this.eosToken),this.unkToken=this.vocab[this.unk_token_id],this.minScore=(0,r.VV)(this.scores)[0],this.unkScore=this.minScore-10,this.scores[this.unk_token_id]=this.unkScore,this.trie=new a.GA,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.sentence,s=t.length,n=0;for(;n<s;){let s=!1,i=[];for(let r of this.trie.commonPrefixSearch(t.slice(n))){i.push(r);let t=this.tokens_to_ids.get(r),o=this.scores[t],a=r.length;e.insert(n,a,o,t),s||1!==a||(s=!0)}s||e.insert(n,1,this.unkScore,this.unk_token_id),n+=1}}tokenize(e){let t=new a.pQ(e,this.bosTokenId,this.eosTokenId);return this.populateNodes(t),t.tokens()}encode(e){let t=[];for(let s of e){let e=this.tokenize(s);t.push(...e)}return t}}let y=(()=>{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),s=0;for(let n=0;n<256;++n)e.includes(n)||(e.push(n),t.push(256+s),s+=1);let n=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,n[t]]))})(),b=(0,n.$2)(y);class v extends k{constructor(e){for(let[t,s]of(super(e),this.BPE_SPLIT_TOKEN=" ",this.tokens_to_ids=u(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[s]=t;this.bpe_ranks=new Map(e.merges.map((e,t)=>[e,t])),this.merges=e.merges.map(e=>e.split(this.BPE_SPLIT_TOKEN)),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.cache=new Map}bpe(e){if(0===e.length)return[];let t=this.cache.get(e);if(void 0!==t)return t;let s=Array.from(e);this.end_of_word_suffix&&(s[s.length-1]+=this.end_of_word_suffix);let n=[];if(s.length>1){let e=new a.Z3((e,t)=>e.score<t.score),t={token:s[0],bias:0,prev:null,next:null},i=t;for(let t=1;t<s.length;++t){let n={bias:t/s.length,token:s[t],prev:i,next:null};i.next=n,this._add_node(e,i),i=n}for(;!e.isEmpty();){let s=e.pop();if(s.deleted||!s.next||s.next.deleted)continue;if(s.deleted=!0,s.next.deleted=!0,s.prev){let e={...s.prev};s.prev.deleted=!0,s.prev=e,e.prev?e.prev.next=e:t=e}let n={token:s.token+s.next.token,bias:s.bias,prev:s.prev,next:s.next.next};n.prev?(n.prev.next=n,this._add_node(e,n.prev)):t=n,n.next&&(n.next.prev=n,this._add_node(e,n))}for(let e=t;null!==e;e=e.next)n.push(e.token)}else n=s;if(this.continuing_subword_suffix)for(let e=0;e<n.length-1;++e)n[e]+=this.continuing_subword_suffix;return this.cache.set(e,n),n}_add_node(e,t){let s=this.bpe_ranks.get(t.token+this.BPE_SPLIT_TOKEN+t.next.token);void 0!==s&&(t.score=s+t.bias,e.push(t))}encode(e){let t=[];for(let s of e)for(let e of this.bpe(s))this.tokens_to_ids.has(e)?t.push(e):this.byte_fallback?t.push(...Array.from(this.text_encoder.encode(e)).map(e=>`<0x${e.toString(16).toUpperCase().padStart(2,"0")}>`)):t.push(this.unk_token);return t}}class z extends k{constructor(e,t){for(let[s,n]of(super(e),this.tokens_to_ids=u(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[n]=s}encode(e){return e}}class A extends n.Ag{constructor(e){super(),this.config=e}static fromConfig(e){if(null===e)return null;switch(e.type){case"BertNormalizer":return new N(e);case"Precompiled":return new eo(e);case"Sequence":return new R(e);case"Replace":return new S(e);case"NFC":return new E(e);case"NFKC":return new T(e);case"NFKD":return new C(e);case"Strip":return new j(e);case"StripAccents":return new M(e);case"Lowercase":return new P(e);case"Prepend":return new $(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error("normalize should be implemented in subclass.")}_call(e){return this.normalize(e)}}class S extends A{normalize(e){let t=h(this.config.pattern);return null===t?e:e.replaceAll(t,this.config.content)}}class E extends A{normalize(e){return e=e.normalize("NFC")}}class T extends A{normalize(e){return e=e.normalize("NFKC")}}class C extends A{normalize(e){return e=e.normalize("NFKD")}}class j extends A{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class M extends A{normalize(e){return e=p(e)}}class P extends A{normalize(e){return e=e.toLowerCase()}}class $ extends A{normalize(e){return e=this.config.prepend+e}}class R extends A{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>A.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class N extends A{_tokenize_chinese_chars(e){let t=[];for(let s=0;s<e.length;++s){let n=e[s],i=n.charCodeAt(0);this._is_chinese_char(i)?(t.push(" "),t.push(n),t.push(" ")):t.push(n)}return t.join("")}_is_chinese_char(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}stripAccents(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}_is_control(e){switch(e){case" ":case"\n":case"\r":return!1;default:return/^\p{Cc}|\p{Cf}|\p{Co}|\p{Cs}$/u.test(e)}}_clean_text(e){let t=[];for(let s of e){let e=s.charCodeAt(0);0===e||65533===e||this._is_control(s)||(/^\s$/.test(s)?t.push(" "):t.push(s))}return t.join("")}normalize(e){return this.config.clean_text&&(e=this._clean_text(e)),this.config.handle_chinese_chars&&(e=this._tokenize_chinese_chars(e)),this.config.lowercase?(e=e.toLowerCase(),!1!==this.config.strip_accents&&(e=this.stripAccents(e))):this.config.strip_accents&&(e=this.stripAccents(e)),e}}class F extends n.Ag{static fromConfig(e){if(null===e)return null;switch(e.type){case"BertPreTokenizer":return new L(e);case"Sequence":return new ea(e);case"Whitespace":return new el(e);case"WhitespaceSplit":return new ec(e);case"Metaspace":return new ei(e);case"ByteLevel":return new O(e);case"Split":return new U(e);case"Punctuation":return new W(e);case"Digits":return new G(e);case"Replace":return new eh(e);default:throw Error(`Unknown PreTokenizer type: ${e.type}`)}}pre_tokenize_text(e,t){throw Error("pre_tokenize_text should be implemented in subclass.")}pre_tokenize(e,t){return(Array.isArray(e)?e.map(e=>this.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class L extends F{constructor(e){super(),this.pattern=RegExp(`[^\\s${f}]+|[${f}]`,"gu")}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class O extends F{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=y,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){return this.add_prefix_space&&!e.startsWith(" ")&&(e=" "+e),(this.use_regex?e.match(this.pattern)||[]:[e]).map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(""))}}class U extends F{constructor(e){super(),this.config=e,this.pattern=h(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return null===this.pattern?[]:this.config.invert?e.match(this.pattern)||[]:function(e,t){let s=[],n=0;for(let i of e.matchAll(t)){let t=i[0];n<i.index&&s.push(e.slice(n,i.index)),t.length>0&&s.push(t),n=i.index+t.length}return n<e.length&&s.push(e.slice(n)),s}(e,this.pattern)}}class W extends F{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${f}]+|[${f}]+`,"gu")}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class G extends F{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=RegExp(t,"gu")}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class I extends n.Ag{constructor(e){super(),this.config=e}static fromConfig(e){if(null===e)return null;switch(e.type){case"TemplateProcessing":return new q(e);case"ByteLevel":return new Y(e);case"RobertaProcessing":return new D(e);case"BertProcessing":return new B(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error("post_process should be implemented in subclass.")}_call(e,...t){return this.post_process(e,...t)}}class B extends I{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:s=!0}={}){s&&(e=(0,n.eG)([this.cls],e,[this.sep]));let i=Array(e.length).fill(0);if(null!==t){let r=s&&this instanceof D?[this.sep]:[],o=s?[this.sep]:[];e=(0,n.eG)(e,r,t,o),i=(0,n.eG)(i,Array(t.length+r.length+o.length).fill(1))}return{tokens:e,token_type_ids:i}}}class D extends B{}class q extends I{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:s=!0}={}){let i=null===t?this.single:this.pair,r=[],o=[];for(let a of i)"SpecialToken"in a?s&&(r.push(a.SpecialToken.id),o.push(a.SpecialToken.type_id)):"Sequence"in a&&("A"===a.Sequence.id?(r=(0,n.eG)(r,e),o=(0,n.eG)(o,Array(e.length).fill(a.Sequence.type_id))):"B"===a.Sequence.id&&(r=(0,n.eG)(r,t),o=(0,n.eG)(o,Array(t.length).fill(a.Sequence.type_id))));return{tokens:r,token_type_ids:o}}}class Y extends I{post_process(e,t=null){return t&&(e=(0,n.eG)(e,t)),{tokens:e}}}class K extends n.Ag{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(null===e)return null;switch(e.type){case"WordPiece":return new Q(e);case"Metaspace":return new er(e);case"ByteLevel":return new X(e);case"Replace":return new Z(e);case"ByteFallback":return new V(e);case"Fuse":return new H(e);case"Strip":return new J(e);case"Sequence":return new et(e);case"CTC":return new ee(e);case"BPEDecoder":return new es(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join("")}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class Z extends K{decode_chain(e){let t=h(this.config.pattern);return null===t?e:e.map(e=>e.replaceAll(t,this.config.content))}}class V extends K{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],s=[];for(let n of e){let e=null;if(6===n.length&&n.startsWith("<0x")&&n.endsWith(">")){let t=parseInt(n.slice(3,5),16);isNaN(t)||(e=t)}if(null!==e)s.push(e);else{if(s.length>0){let e=this.text_decoder.decode(Uint8Array.from(s));t.push(e),s=[]}t.push(n)}}if(s.length>0){let e=this.text_decoder.decode(Uint8Array.from(s));t.push(e),s=[]}return t}}class H extends K{decode_chain(e){return[e.join("")]}}class J extends K{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let s=0;s<this.start;++s){if(e[s]===this.content){t=s+1;continue}break}let s=e.length;for(let t=0;t<this.stop;++t){let n=e.length-t-1;if(e[n]===this.content){s=n;continue}break}return e.slice(t,s)})}}class Q extends K{constructor(e){super(e),this.cleanup=e.cleanup}decode_chain(e){return e.map((e,t)=>(0!==t&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,""):" "+e),this.cleanup&&(e=_(e)),e))}}class X extends K{constructor(e){super(e),this.byte_decoder=b,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=new Uint8Array([...e.join("")].map(e=>this.byte_decoder[e]));return this.text_decoder.decode(t)}decode_chain(e){let t=[],s=[];for(let n of e)void 0!==this.added_tokens.find(e=>e.content===n)?(s.length>0&&(t.push(this.convert_tokens_to_string(s)),s=[]),t.push(n)):s.push(n);return s.length>0&&t.push(this.convert_tokens_to_string(s)),t}}class ee extends K{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(0===e.length)return"";let t=[e[0]];for(let s=1;s<e.length;++s)e[s]!==t.at(-1)&&t.push(e[s]);let s=t.filter(e=>e!==this.pad_token).join("");return this.cleanup&&(s=_(s).replaceAll(this.word_delimiter_token," ").trim()),s}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class et extends K{constructor(e){super(e),this.decoders=e.decoders.map(e=>K.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class es extends K{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,s)=>t.replaceAll(this.suffix,s===e.length-1?"":" "))}}class en extends K{decode_chain(e){let t="";for(let s=1;s<e.length;s+=2)t+=e[s];return[t]}}class ei extends F{constructor(e){super(),this.addPrefixSpace=e.add_prefix_space,this.replacement=e.replacement,this.strRep=e.str_rep||this.replacement,this.prepend_scheme=e.prepend_scheme??"always"}pre_tokenize_text(e,{section_index:t}={}){let s=e.replaceAll(" ",this.strRep);return this.addPrefixSpace&&!s.startsWith(this.replacement)&&("always"===this.prepend_scheme||"first"===this.prepend_scheme&&0===t)&&(s=this.strRep+s),[s]}}class er extends K{constructor(e){super(e),this.addPrefixSpace=e.add_prefix_space,this.replacement=e.replacement}decode_chain(e){let t=[];for(let s=0;s<e.length;++s){let n=e[s].replaceAll(this.replacement," ");this.addPrefixSpace&&0==s&&n.startsWith(" ")&&(n=n.substring(1)),t.push(n)}return t}}class eo extends A{constructor(e){super(e),this.charsmap=e.precompiled_charsmap}normalize(e){return e=(e=(e=e.replace(/[\u0001-\u0008\u000B\u000E-\u001F\u007F\u008F\u009F]/gm,"")).replace(/[\u0009\u000A\u000C\u000D\u1680\u200B\u200C\u200E\u200F\u2028\u2029\u2581\uFEFF\uFFFD]/gm," ")).includes("~")?e.split("~").map(e=>e.normalize("NFKC")).join("~"):e.normalize("NFKC")}}class ea extends F{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>F.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,s)=>s.pre_tokenize(e,t),[e])}}class el extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class ec extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\S+/g)||[]}}class eh extends F{constructor(e){super(),this.config=e,this.pattern=h(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return null===this.pattern?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let eu=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];class ed extends n.Ag{return_token_type_ids=!1;_default_chat_template=`{% for message in messages %}{{'<|im_start|>' + message['role'] + '
2
  ' + message['content'] + '<|im_end|>' + '
3
  '}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
4
  ' }}{% endif %}`;constructor(e,t){for(let s of(super(),this._tokenizer_config=t,this.normalizer=A.fromConfig(e.normalizer),this.pre_tokenizer=F.fromConfig(e.pre_tokenizer),this.model=k.fromConfig(e.model,t),this.post_processor=I.fromConfig(e.post_processor),this.decoder=K.fromConfig(e.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[],e.added_tokens)){let e=new m(s);this.added_tokens.push(e),this.model.tokens_to_ids.set(e.content,e.id),this.model.vocab[e.id]=e.content,e.special&&(this.special_tokens.push(e.content),this.all_special_ids.push(e.id))}if(this.additional_special_tokens=t.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_regex=this.added_tokens.length>0?new RegExp(this.added_tokens.map(e=>`${e.lstrip?"\\s*":""}(${(0,n.hr)(e.content)})${e.rstrip?"\\s*":""}`).join("|")):null,this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,this.padding_side="right",this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:s}of this.chat_template){if("string"!=typeof t||"string"!=typeof s)throw Error('Chat template must be a list of objects with "name" and "template" properties');e[t]=s}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this._tokenizer_config[t];if(e){if("object"!=typeof e)return e;if("AddedToken"===e.__type)return e.content;throw Error(`Unknown token: ${e}`)}}return null}static async from_pretrained(e,{progress_callback:t=null,config:s=null,cache_dir:n=null,local_files_only:i=!1,revision:r="main",legacy:o=null}={}){return new this(...await c(e,{progress_callback:t,config:s,cache_dir:n,local_files_only:i,revision:r,legacy:o}))}_call(e,{text_pair:t=null,add_special_tokens:s=!0,padding:i=!1,truncation:a=null,max_length:l=null,return_tensor:c=!0}={}){let h;let u=Array.isArray(e);if(u){if(0===e.length)throw Error("text array must be non-empty");if(null!==t){if(Array.isArray(t)){if(e.length!==t.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");h=e.map((e,n)=>this._encode_plus(e,t[n],{add_special_tokens:s}))}else h=e.map(e=>this._encode_plus(e,null,{add_special_tokens:s}))}else{if(null==e)throw Error("text may not be null or undefined");if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");h=[this._encode_plus(e,t,{add_special_tokens:s})]}if(null===l?l="max_length"===i?this.model_max_length:(0,r.Fp)(h.map(e=>e.input_ids.length))[0]:a||console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=true` to explicitly truncate examples to max length."),l=Math.min(l,this.model_max_length),i||a)for(let e=0;e<h.length;++e)h[e].input_ids.length!==l&&(h[e].input_ids.length>l?a&&function(e,t){for(let s of Object.keys(e))e[s].length=t}(h[e],l):i&&function(e,t,s,i){for(let r of Object.keys(e)){let o=t-e[r].length,a=s(r),l=Array(o).fill(a);e[r]="right"===i?(0,n.eG)(e[r],l):(0,n.eG)(l,e[r])}}(h[e],l,e=>"input_ids"===e?this.pad_token_id:0,this.padding_side));let d={};if(c){if(!(i&&a)&&h.some(e=>{for(let t of Object.keys(e))if(e[t].length!==h[0][t]?.length)return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");let e=[h.length,h[0].input_ids.length];for(let t of Object.keys(h[0]))d[t]=new o.es("int64",BigInt64Array.from(h.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(h[0]))d[e]=h.map(t=>t[e]);if(!u)for(let e of Object.keys(d))d[e]=d[e][0]}return d}_encode_text(e){return null===e?null:(this.added_tokens_regex?e.split(this.added_tokens_regex).filter(e=>e):[e]).map((e,t)=>{if(void 0!==this.added_tokens.find(t=>t.content===e))return e;{if(!0===this.remove_space&&(e=e.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(e=p(e.toLowerCase())),null!==this.normalizer&&(e=this.normalizer(e)),0===e.length)return[];let s=null!==this.pre_tokenizer?this.pre_tokenizer(e,{section_index:t}):[e];return this.model(s)}}).flat()}_encode_plus(e,t=null,{add_special_tokens:s=!0}={}){let i=this._encode_text(e),r=this._encode_text(t),o=this.post_processor?this.post_processor(i,r,{add_special_tokens:s}):{tokens:(0,n.eG)(i??[],r??[])},a=this.model.convert_tokens_to_ids(o.tokens),l={input_ids:a,attention_mask:Array(a.length).fill(1)};return this.return_token_type_ids&&o.token_type_ids&&(l.token_type_ids=o.token_type_ids),l}encode(e,t=null,{add_special_tokens:s=!0}={}){let{input_ids:n}=this._encode_plus(e,t,{add_special_tokens:s});return n}batch_decode(e,t={}){return e instanceof o.es&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof o.es&&(e=d(e)),!Array.isArray(e)||0===e.length||!(0,n.Wy)(e[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:s=null}){let n=this.model.convert_ids_to_tokens(e);t&&(n=n.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(n):n.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix," "),t&&(i=i.trim())),(s??this.clean_up_tokenization_spaces)&&(i=_(i)),i}get default_chat_template(){return this._warned_about_chat_template||(console.warn("No chat template is defined for this tokenizer - using a default chat template that implements the ChatML format. If the default is not appropriate for your model, please set `tokenizer.chat_template` to an appropriate template. See https://huggingface.co/docs/transformers/main/chat_templating for more information."),this._warned_about_chat_template=!0),this._default_chat_template}apply_chat_template(e,{chat_template:t=null,add_generation_prompt:s=!1,tokenize:n=!0,padding:i=!1,truncation:r=!1,max_length:o=null,return_tensor:a=!0,tokenizer_kwargs:c={},...h}={}){if(this.chat_template&&"object"==typeof this.chat_template||null===this.chat_template&&this.default_chat_template&&"object"==typeof this.default_chat_template){let e=this.chat_template??this.default_chat_template;if(null!==t&&Object.hasOwn(e,t))t=e[t];else if(null===t&&"default"in e)t=e.default;else if(null===t)throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(e).sort()}.`)}else t??=this.chat_template??this.default_chat_template;if("string"!=typeof t)throw Error(`chat_template must be a string, but got ${typeof t}`);let u=this._compiled_template_cache.get(t);void 0===u&&(u=new l.YS(t),this._compiled_template_cache.set(t,u));let d=Object.create(null);for(let e of eu){let t=this.getToken(e);t&&(d[e]=t)}let _=u.render({messages:e,add_generation_prompt:s,...d,...h});return n?this._call(_,{add_special_tokens:!1,padding:i,truncation:r,max_length:o,return_tensor:a,...c}).input_ids:_}}class e_ extends ed{return_token_type_ids=!0}class ep extends ed{return_token_type_ids=!0}class ef extends ed{return_token_type_ids=!0}class eg extends ed{return_token_type_ids=!0}class em extends ed{return_token_type_ids=!0}class ek extends ed{return_token_type_ids=!0}class ex extends ed{return_token_type_ids=!0}class ew extends ed{return_token_type_ids=!0}class ey extends ed{return_token_type_ids=!0}class eb extends ed{}class ev extends ed{}class ez extends ed{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class eA extends ed{return_token_type_ids=!0}class eS extends ed{}class eE extends ed{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}'}class eT extends ed{}class eC extends ed{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,s){return eB(this,e,t,s)}}class ej extends eC{}class eM extends ed{}class eP extends eE{constructor(e,t){let s=".,!?β€¦γ€‚οΌŒγ€ΰ₯€Ϋ”ΨŒ",n=e.pre_tokenizer?.pretokenizers[0]?.pattern;n&&n.Regex===` ?[^(\\s|[${s}])]+`&&(n.Regex=` ?[^\\s${s}]+`),super(e,t)}}class e$ extends ed{_default_chat_template=`{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif USE_DEFAULT_PROMPT == true and not '<<SYS>>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'DEFAULT_SYSTEM_MESSAGE' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<<SYS>>
 
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[165],{2018:function(e,t,s){s.d(t,{t2:function(){return e9}});var n=s(761),i=s(911),r=s(8709),o=s(2414),a=s(1510),l=s(4087);async function c(e,t){let s=await Promise.all([(0,i.yM)(e,"tokenizer.json",!0,t),(0,i.yM)(e,"tokenizer_config.json",!0,t)]);return null!==t.legacy&&(s[1].legacy=t.legacy),s}function h(e,t=!0){if(void 0!==e.Regex){let t=e.Regex.replace(/\\([#&~])/g,"$1");for(let[e,s]of g)t=t.replaceAll(e,s);return RegExp(t,"gu")}if(void 0===e.String)return console.warn("Unknown pattern type:",e),null;{let s=(0,n.hr)(e.String);return RegExp(t?s:`(${s})`,"gu")}}function u(e){return new Map(Object.entries(e))}function d(e){let t=e.dims;switch(t.length){case 1:return e.tolist();case 2:if(1!==t[0])throw Error("Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.");return e.tolist()[0];default:throw Error(`Expected tensor to have 1-2 dimensions, got ${t.length}.`)}}function _(e){return e.replace(/ \./g,".").replace(/ \?/g,"?").replace(/ \!/g,"!").replace(/ ,/g,",").replace(/ \' /g,"'").replace(/ n\'t/g,"n't").replace(/ \'m/g,"'m").replace(/ \'s/g,"'s").replace(/ \'ve/g,"'ve").replace(/ \'re/g,"'re")}function p(e){return e.replace(/[\u0300-\u036f]/g,"")}let f="\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E",g=new Map([["(?i:'s|'t|'re|'ve|'m|'ll|'d)","(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))"]]);class m{constructor(e){this.content=e.content,this.id=e.id,this.single_word=e.single_word??!1,this.lstrip=e.lstrip??!1,this.rstrip=e.rstrip??!1,this.special=e.special??!1,this.normalized=e.normalized??null}}class k extends n.Ag{constructor(e){super(),this.config=e,this.vocab=[],this.tokens_to_ids=new Map,this.unk_token_id=void 0,this.unk_token=void 0,this.end_of_word_suffix=void 0,this.fuse_unk=this.config.fuse_unk??!1}static fromConfig(e,...t){switch(e.type){case"WordPiece":return new x(e);case"Unigram":return new w(e,...t);case"BPE":return new v(e);default:if(e.vocab)return new z(e,...t);throw Error(`Unknown TokenizerModel type: ${e.type}`)}}_call(e){let t=this.encode(e);return this.fuse_unk&&(t=function(e,t,s){let n=[],i=0;for(;i<e.length;){if(n.push(e[i]),(s.get(e[i])??t)!==t){++i;continue}for(;i<e.length&&(s.get(e[i])??t)===t;)++i}return n}(t,this.unk_token_id,this.tokens_to_ids)),t}encode(e){throw Error("encode should be implemented in subclass.")}convert_tokens_to_ids(e){return e.map(e=>this.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class x extends k{constructor(e){for(let[t,s]of(super(e),this.tokens_to_ids=u(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[s]=t}encode(e){let t=[];for(let s of e){let e=[...s];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let n=!1,i=0,r=[];for(;i<e.length;){let t=e.length,s=null;for(;i<t;){let n=e.slice(i,t).join("");if(i>0&&(n=this.config.continuing_subword_prefix+n),this.tokens_to_ids.has(n)){s=n;break}--t}if(null===s){n=!0;break}r.push(s),i=t}n?t.push(this.unk_token):t.push(...r)}return t}}class w extends k{constructor(e,t){super(e);let s=e.vocab.length;this.vocab=Array(s),this.scores=Array(s);for(let t=0;t<s;++t){let s=e.vocab[t];this.vocab[t]=s[0],this.scores[t]=s[1]}this.unk_token_id=e.unk_id,this.unk_token=this.vocab[e.unk_id],this.tokens_to_ids=new Map(this.vocab.map((e,t)=>[e,t])),this.bosToken=" ",this.bosTokenId=this.tokens_to_ids.get(this.bosToken),this.eosToken=t.eos_token,this.eosTokenId=this.tokens_to_ids.get(this.eosToken),this.unkToken=this.vocab[this.unk_token_id],this.minScore=(0,r.VV)(this.scores)[0],this.unkScore=this.minScore-10,this.scores[this.unk_token_id]=this.unkScore,this.trie=new a.GA,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.sentence,s=t.length,n=0;for(;n<s;){let s=!1,i=[];for(let r of this.trie.commonPrefixSearch(t.slice(n))){i.push(r);let t=this.tokens_to_ids.get(r),o=this.scores[t],a=r.length;e.insert(n,a,o,t),s||1!==a||(s=!0)}s||e.insert(n,1,this.unkScore,this.unk_token_id),n+=1}}tokenize(e){let t=new a.pQ(e,this.bosTokenId,this.eosTokenId);return this.populateNodes(t),t.tokens()}encode(e){let t=[];for(let s of e){let e=this.tokenize(s);t.push(...e)}return t}}let y=(()=>{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),s=0;for(let n=0;n<256;++n)e.includes(n)||(e.push(n),t.push(256+s),s+=1);let n=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,n[t]]))})(),b=(0,n.$2)(y);class v extends k{constructor(e){for(let[t,s]of(super(e),this.BPE_SPLIT_TOKEN=" ",this.tokens_to_ids=u(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[s]=t;this.bpe_ranks=new Map(e.merges.map((e,t)=>[e,t])),this.merges=e.merges.map(e=>e.split(this.BPE_SPLIT_TOKEN)),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.cache=new Map}bpe(e){if(0===e.length)return[];let t=this.cache.get(e);if(void 0!==t)return t;let s=Array.from(e);this.end_of_word_suffix&&(s[s.length-1]+=this.end_of_word_suffix);let n=[];if(s.length>1){let e=new a.Z3((e,t)=>e.score<t.score),t={token:s[0],bias:0,prev:null,next:null},i=t;for(let t=1;t<s.length;++t){let n={bias:t/s.length,token:s[t],prev:i,next:null};i.next=n,this._add_node(e,i),i=n}for(;!e.isEmpty();){let s=e.pop();if(s.deleted||!s.next||s.next.deleted)continue;if(s.deleted=!0,s.next.deleted=!0,s.prev){let e={...s.prev};s.prev.deleted=!0,s.prev=e,e.prev?e.prev.next=e:t=e}let n={token:s.token+s.next.token,bias:s.bias,prev:s.prev,next:s.next.next};n.prev?(n.prev.next=n,this._add_node(e,n.prev)):t=n,n.next&&(n.next.prev=n,this._add_node(e,n))}for(let e=t;null!==e;e=e.next)n.push(e.token)}else n=s;if(this.continuing_subword_suffix)for(let e=0;e<n.length-1;++e)n[e]+=this.continuing_subword_suffix;return this.cache.set(e,n),n}_add_node(e,t){let s=this.bpe_ranks.get(t.token+this.BPE_SPLIT_TOKEN+t.next.token);void 0!==s&&(t.score=s+t.bias,e.push(t))}encode(e){let t=[];for(let s of e)for(let e of this.bpe(s))this.tokens_to_ids.has(e)?t.push(e):this.byte_fallback?t.push(...Array.from(this.text_encoder.encode(e)).map(e=>`<0x${e.toString(16).toUpperCase().padStart(2,"0")}>`)):t.push(this.unk_token);return t}}class z extends k{constructor(e,t){for(let[s,n]of(super(e),this.tokens_to_ids=u(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size),this.tokens_to_ids))this.vocab[n]=s}encode(e){return e}}class A extends n.Ag{constructor(e){super(),this.config=e}static fromConfig(e){if(null===e)return null;switch(e.type){case"BertNormalizer":return new N(e);case"Precompiled":return new eo(e);case"Sequence":return new R(e);case"Replace":return new S(e);case"NFC":return new E(e);case"NFKC":return new T(e);case"NFKD":return new C(e);case"Strip":return new j(e);case"StripAccents":return new M(e);case"Lowercase":return new P(e);case"Prepend":return new $(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error("normalize should be implemented in subclass.")}_call(e){return this.normalize(e)}}class S extends A{normalize(e){let t=h(this.config.pattern);return null===t?e:e.replaceAll(t,this.config.content)}}class E extends A{normalize(e){return e=e.normalize("NFC")}}class T extends A{normalize(e){return e=e.normalize("NFKC")}}class C extends A{normalize(e){return e=e.normalize("NFKD")}}class j extends A{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class M extends A{normalize(e){return e=p(e)}}class P extends A{normalize(e){return e=e.toLowerCase()}}class $ extends A{normalize(e){return e=this.config.prepend+e}}class R extends A{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>A.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class N extends A{_tokenize_chinese_chars(e){let t=[];for(let s=0;s<e.length;++s){let n=e[s],i=n.charCodeAt(0);this._is_chinese_char(i)?(t.push(" "),t.push(n),t.push(" ")):t.push(n)}return t.join("")}_is_chinese_char(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}stripAccents(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}_is_control(e){switch(e){case" ":case"\n":case"\r":return!1;default:return/^\p{Cc}|\p{Cf}|\p{Co}|\p{Cs}$/u.test(e)}}_clean_text(e){let t=[];for(let s of e){let e=s.charCodeAt(0);0===e||65533===e||this._is_control(s)||(/^\s$/.test(s)?t.push(" "):t.push(s))}return t.join("")}normalize(e){return this.config.clean_text&&(e=this._clean_text(e)),this.config.handle_chinese_chars&&(e=this._tokenize_chinese_chars(e)),this.config.lowercase?(e=e.toLowerCase(),!1!==this.config.strip_accents&&(e=this.stripAccents(e))):this.config.strip_accents&&(e=this.stripAccents(e)),e}}class F extends n.Ag{static fromConfig(e){if(null===e)return null;switch(e.type){case"BertPreTokenizer":return new L(e);case"Sequence":return new ea(e);case"Whitespace":return new el(e);case"WhitespaceSplit":return new ec(e);case"Metaspace":return new ei(e);case"ByteLevel":return new O(e);case"Split":return new U(e);case"Punctuation":return new W(e);case"Digits":return new G(e);case"Replace":return new eh(e);default:throw Error(`Unknown PreTokenizer type: ${e.type}`)}}pre_tokenize_text(e,t){throw Error("pre_tokenize_text should be implemented in subclass.")}pre_tokenize(e,t){return(Array.isArray(e)?e.map(e=>this.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class L extends F{constructor(e){super(),this.pattern=RegExp(`[^\\s${f}]+|[${f}]`,"gu")}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class O extends F{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=y,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){return this.add_prefix_space&&!e.startsWith(" ")&&(e=" "+e),(this.use_regex?e.match(this.pattern)||[]:[e]).map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(""))}}class U extends F{constructor(e){super(),this.config=e,this.pattern=h(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return null===this.pattern?[]:this.config.invert?e.match(this.pattern)||[]:function(e,t){let s=[],n=0;for(let i of e.matchAll(t)){let t=i[0];n<i.index&&s.push(e.slice(n,i.index)),t.length>0&&s.push(t),n=i.index+t.length}return n<e.length&&s.push(e.slice(n)),s}(e,this.pattern)}}class W extends F{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${f}]+|[${f}]+`,"gu")}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class G extends F{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=RegExp(t,"gu")}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class I extends n.Ag{constructor(e){super(),this.config=e}static fromConfig(e){if(null===e)return null;switch(e.type){case"TemplateProcessing":return new q(e);case"ByteLevel":return new Y(e);case"RobertaProcessing":return new D(e);case"BertProcessing":return new B(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error("post_process should be implemented in subclass.")}_call(e,...t){return this.post_process(e,...t)}}class B extends I{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:s=!0}={}){s&&(e=(0,n.eG)([this.cls],e,[this.sep]));let i=Array(e.length).fill(0);if(null!==t){let r=s&&this instanceof D?[this.sep]:[],o=s?[this.sep]:[];e=(0,n.eG)(e,r,t,o),i=(0,n.eG)(i,Array(t.length+r.length+o.length).fill(1))}return{tokens:e,token_type_ids:i}}}class D extends B{}class q extends I{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:s=!0}={}){let i=null===t?this.single:this.pair,r=[],o=[];for(let a of i)"SpecialToken"in a?s&&(r.push(a.SpecialToken.id),o.push(a.SpecialToken.type_id)):"Sequence"in a&&("A"===a.Sequence.id?(r=(0,n.eG)(r,e),o=(0,n.eG)(o,Array(e.length).fill(a.Sequence.type_id))):"B"===a.Sequence.id&&(r=(0,n.eG)(r,t),o=(0,n.eG)(o,Array(t.length).fill(a.Sequence.type_id))));return{tokens:r,token_type_ids:o}}}class Y extends I{post_process(e,t=null){return t&&(e=(0,n.eG)(e,t)),{tokens:e}}}class K extends n.Ag{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(null===e)return null;switch(e.type){case"WordPiece":return new Q(e);case"Metaspace":return new er(e);case"ByteLevel":return new X(e);case"Replace":return new Z(e);case"ByteFallback":return new V(e);case"Fuse":return new H(e);case"Strip":return new J(e);case"Sequence":return new et(e);case"CTC":return new ee(e);case"BPEDecoder":return new es(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join("")}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class Z extends K{decode_chain(e){let t=h(this.config.pattern);return null===t?e:e.map(e=>e.replaceAll(t,this.config.content))}}class V extends K{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],s=[];for(let n of e){let e=null;if(6===n.length&&n.startsWith("<0x")&&n.endsWith(">")){let t=parseInt(n.slice(3,5),16);isNaN(t)||(e=t)}if(null!==e)s.push(e);else{if(s.length>0){let e=this.text_decoder.decode(Uint8Array.from(s));t.push(e),s=[]}t.push(n)}}if(s.length>0){let e=this.text_decoder.decode(Uint8Array.from(s));t.push(e),s=[]}return t}}class H extends K{decode_chain(e){return[e.join("")]}}class J extends K{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let s=0;s<this.start;++s){if(e[s]===this.content){t=s+1;continue}break}let s=e.length;for(let t=0;t<this.stop;++t){let n=e.length-t-1;if(e[n]===this.content){s=n;continue}break}return e.slice(t,s)})}}class Q extends K{constructor(e){super(e),this.cleanup=e.cleanup}decode_chain(e){return e.map((e,t)=>(0!==t&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,""):" "+e),this.cleanup&&(e=_(e)),e))}}class X extends K{constructor(e){super(e),this.byte_decoder=b,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=new Uint8Array([...e.join("")].map(e=>this.byte_decoder[e]));return this.text_decoder.decode(t)}decode_chain(e){let t=[],s=[];for(let n of e)void 0!==this.added_tokens.find(e=>e.content===n)?(s.length>0&&(t.push(this.convert_tokens_to_string(s)),s=[]),t.push(n)):s.push(n);return s.length>0&&t.push(this.convert_tokens_to_string(s)),t}}class ee extends K{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(0===e.length)return"";let t=[e[0]];for(let s=1;s<e.length;++s)e[s]!==t.at(-1)&&t.push(e[s]);let s=t.filter(e=>e!==this.pad_token).join("");return this.cleanup&&(s=_(s).replaceAll(this.word_delimiter_token," ").trim()),s}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class et extends K{constructor(e){super(e),this.decoders=e.decoders.map(e=>K.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class es extends K{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,s)=>t.replaceAll(this.suffix,s===e.length-1?"":" "))}}class en extends K{decode_chain(e){let t="";for(let s=1;s<e.length;s+=2)t+=e[s];return[t]}}class ei extends F{constructor(e){super(),this.addPrefixSpace=e.add_prefix_space,this.replacement=e.replacement,this.strRep=e.str_rep||this.replacement,this.prepend_scheme=e.prepend_scheme??"always"}pre_tokenize_text(e,{section_index:t}={}){let s=e.replaceAll(" ",this.strRep);return this.addPrefixSpace&&!s.startsWith(this.replacement)&&("always"===this.prepend_scheme||"first"===this.prepend_scheme&&0===t)&&(s=this.strRep+s),[s]}}class er extends K{constructor(e){super(e),this.addPrefixSpace=e.add_prefix_space,this.replacement=e.replacement}decode_chain(e){let t=[];for(let s=0;s<e.length;++s){let n=e[s].replaceAll(this.replacement," ");this.addPrefixSpace&&0==s&&n.startsWith(" ")&&(n=n.substring(1)),t.push(n)}return t}}class eo extends A{constructor(e){super(e),this.charsmap=e.precompiled_charsmap}normalize(e){return e=(e=(e=e.replace(/[\u0001-\u0008\u000B\u000E-\u001F\u007F\u008F\u009F]/gm,"")).replace(/[\u0009\u000A\u000C\u000D\u1680\u200B\u200C\u200E\u200F\u2028\u2029\u2581\uFEFF\uFFFD]/gm," ")).includes("~")?e.split("~").map(e=>e.normalize("NFKC")).join("~"):e.normalize("NFKC")}}class ea extends F{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>F.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,s)=>s.pre_tokenize(e,t),[e])}}class el extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class ec extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\S+/g)||[]}}class eh extends F{constructor(e){super(),this.config=e,this.pattern=h(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return null===this.pattern?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let eu=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];class ed extends n.Ag{return_token_type_ids=!1;_default_chat_template=`{% for message in messages %}{{'<|im_start|>' + message['role'] + '
2
  ' + message['content'] + '<|im_end|>' + '
3
  '}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
4
  ' }}{% endif %}`;constructor(e,t){for(let s of(super(),this._tokenizer_config=t,this.normalizer=A.fromConfig(e.normalizer),this.pre_tokenizer=F.fromConfig(e.pre_tokenizer),this.model=k.fromConfig(e.model,t),this.post_processor=I.fromConfig(e.post_processor),this.decoder=K.fromConfig(e.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[],e.added_tokens)){let e=new m(s);this.added_tokens.push(e),this.model.tokens_to_ids.set(e.content,e.id),this.model.vocab[e.id]=e.content,e.special&&(this.special_tokens.push(e.content),this.all_special_ids.push(e.id))}if(this.additional_special_tokens=t.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_regex=this.added_tokens.length>0?new RegExp(this.added_tokens.map(e=>`${e.lstrip?"\\s*":""}(${(0,n.hr)(e.content)})${e.rstrip?"\\s*":""}`).join("|")):null,this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,this.padding_side="right",this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:s}of this.chat_template){if("string"!=typeof t||"string"!=typeof s)throw Error('Chat template must be a list of objects with "name" and "template" properties');e[t]=s}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this._tokenizer_config[t];if(e){if("object"!=typeof e)return e;if("AddedToken"===e.__type)return e.content;throw Error(`Unknown token: ${e}`)}}return null}static async from_pretrained(e,{progress_callback:t=null,config:s=null,cache_dir:n=null,local_files_only:i=!1,revision:r="main",legacy:o=null}={}){return new this(...await c(e,{progress_callback:t,config:s,cache_dir:n,local_files_only:i,revision:r,legacy:o}))}_call(e,{text_pair:t=null,add_special_tokens:s=!0,padding:i=!1,truncation:a=null,max_length:l=null,return_tensor:c=!0}={}){let h;let u=Array.isArray(e);if(u){if(0===e.length)throw Error("text array must be non-empty");if(null!==t){if(Array.isArray(t)){if(e.length!==t.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");h=e.map((e,n)=>this._encode_plus(e,t[n],{add_special_tokens:s}))}else h=e.map(e=>this._encode_plus(e,null,{add_special_tokens:s}))}else{if(null==e)throw Error("text may not be null or undefined");if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");h=[this._encode_plus(e,t,{add_special_tokens:s})]}if(null===l?l="max_length"===i?this.model_max_length:(0,r.Fp)(h.map(e=>e.input_ids.length))[0]:a||console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=true` to explicitly truncate examples to max length."),l=Math.min(l,this.model_max_length),i||a)for(let e=0;e<h.length;++e)h[e].input_ids.length!==l&&(h[e].input_ids.length>l?a&&function(e,t){for(let s of Object.keys(e))e[s].length=t}(h[e],l):i&&function(e,t,s,i){for(let r of Object.keys(e)){let o=t-e[r].length,a=s(r),l=Array(o).fill(a);e[r]="right"===i?(0,n.eG)(e[r],l):(0,n.eG)(l,e[r])}}(h[e],l,e=>"input_ids"===e?this.pad_token_id:0,this.padding_side));let d={};if(c){if(!(i&&a)&&h.some(e=>{for(let t of Object.keys(e))if(e[t].length!==h[0][t]?.length)return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");let e=[h.length,h[0].input_ids.length];for(let t of Object.keys(h[0]))d[t]=new o.es("int64",BigInt64Array.from(h.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(h[0]))d[e]=h.map(t=>t[e]);if(!u)for(let e of Object.keys(d))d[e]=d[e][0]}return d}_encode_text(e){return null===e?null:(this.added_tokens_regex?e.split(this.added_tokens_regex).filter(e=>e):[e]).map((e,t)=>{if(void 0!==this.added_tokens.find(t=>t.content===e))return e;{if(!0===this.remove_space&&(e=e.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(e=p(e.toLowerCase())),null!==this.normalizer&&(e=this.normalizer(e)),0===e.length)return[];let s=null!==this.pre_tokenizer?this.pre_tokenizer(e,{section_index:t}):[e];return this.model(s)}}).flat()}_encode_plus(e,t=null,{add_special_tokens:s=!0}={}){let i=this._encode_text(e),r=this._encode_text(t),o=this.post_processor?this.post_processor(i,r,{add_special_tokens:s}):{tokens:(0,n.eG)(i??[],r??[])},a=this.model.convert_tokens_to_ids(o.tokens),l={input_ids:a,attention_mask:Array(a.length).fill(1)};return this.return_token_type_ids&&o.token_type_ids&&(l.token_type_ids=o.token_type_ids),l}encode(e,t=null,{add_special_tokens:s=!0}={}){let{input_ids:n}=this._encode_plus(e,t,{add_special_tokens:s});return n}batch_decode(e,t={}){return e instanceof o.es&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof o.es&&(e=d(e)),!Array.isArray(e)||0===e.length||!(0,n.Wy)(e[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:s=null}){let n=this.model.convert_ids_to_tokens(e);t&&(n=n.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(n):n.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix," "),t&&(i=i.trim())),(s??this.clean_up_tokenization_spaces)&&(i=_(i)),i}get default_chat_template(){return this._warned_about_chat_template||(console.warn("No chat template is defined for this tokenizer - using a default chat template that implements the ChatML format. If the default is not appropriate for your model, please set `tokenizer.chat_template` to an appropriate template. See https://huggingface.co/docs/transformers/main/chat_templating for more information."),this._warned_about_chat_template=!0),this._default_chat_template}apply_chat_template(e,{chat_template:t=null,add_generation_prompt:s=!1,tokenize:n=!0,padding:i=!1,truncation:r=!1,max_length:o=null,return_tensor:a=!0,tokenizer_kwargs:c={},...h}={}){if(this.chat_template&&"object"==typeof this.chat_template||null===this.chat_template&&this.default_chat_template&&"object"==typeof this.default_chat_template){let e=this.chat_template??this.default_chat_template;if(null!==t&&Object.hasOwn(e,t))t=e[t];else if(null===t&&"default"in e)t=e.default;else if(null===t)throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(e).sort()}.`)}else t??=this.chat_template??this.default_chat_template;if("string"!=typeof t)throw Error(`chat_template must be a string, but got ${typeof t}`);let u=this._compiled_template_cache.get(t);void 0===u&&(u=new l.YS(t),this._compiled_template_cache.set(t,u));let d=Object.create(null);for(let e of eu){let t=this.getToken(e);t&&(d[e]=t)}let _=u.render({messages:e,add_generation_prompt:s,...d,...h});return n?this._call(_,{add_special_tokens:!1,padding:i,truncation:r,max_length:o,return_tensor:a,...c}).input_ids:_}}class e_ extends ed{return_token_type_ids=!0}class ep extends ed{return_token_type_ids=!0}class ef extends ed{return_token_type_ids=!0}class eg extends ed{return_token_type_ids=!0}class em extends ed{return_token_type_ids=!0}class ek extends ed{return_token_type_ids=!0}class ex extends ed{return_token_type_ids=!0}class ew extends ed{return_token_type_ids=!0}class ey extends ed{return_token_type_ids=!0}class eb extends ed{}class ev extends ed{}class ez extends ed{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class eA extends ed{return_token_type_ids=!0}class eS extends ed{}class eE extends ed{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}'}class eT extends ed{}class eC extends ed{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,s){return eB(this,e,t,s)}}class ej extends eC{}class eM extends ed{}class eP extends eE{constructor(e,t){let s=".,!?β€¦γ€‚οΌŒγ€ΰ₯€Ϋ”ΨŒ",n=e.pre_tokenizer?.pretokenizers[0]?.pattern;n&&n.Regex===` ?[^(\\s|[${s}])]+`&&(n.Regex=` ?[^\\s${s}]+`),super(e,t)}}class e$ extends ed{_default_chat_template=`{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif USE_DEFAULT_PROMPT == true and not '<<SYS>>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'DEFAULT_SYSTEM_MESSAGE' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<<SYS>>
_next/static/chunks/6139e184.ec466d5482164223.js ADDED
@@ -0,0 +1 @@
 
 
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[132],{9454:function(e,s,t){t.d(s,{$Bv:function(){return ia},$Sz:function(){return a2},DcG:function(){return ic},ENH:function(){return ir},En$:function(){return is},Hqk:function(){return a7},IFL:function(){return iu},K2m:function(){return il},Kf0:function(){return a4},LdW:function(){return io},OjJ:function(){return a1},S2d:function(){return id},U$$:function(){return it},Zn:function(){return ii},hY6:function(){return i_},hZO:function(){return a3},lbf:function(){return a5},o$X:function(){return a0},t78:function(){return a9},tLj:function(){return ie},wiU:function(){return a8},z6E:function(){return a6}});var n=t(16),a=t(761),i=t(911),o=t(5774),r=t(2414),l=t(967),c=t(9078);let{InferenceSession:d,Tensor:_,env:u}=l.ONNX,h={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5},m=new Map,p=new Map,f=new Map;async function g(e,s,t){let n=`onnx/${s}${t.quantized?"_quantized":""}.onnx`,a=await (0,i.st)(e,n,!0,t);try{return await d.create(a,{executionProviders:l.p})}catch(e){if(1===l.p.length&&"wasm"===l.p[0])throw e;return console.warn(e),console.warn("Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. "),await d.create(a,{executionProviders:["wasm"]})}}async function w(e,s){let t=function(e,s){let t=Object.create(null),n=[];for(let a of e.inputNames){let e=s[a];if(!(e instanceof r.es)){n.push(a);continue}t[a]=u.wasm.proxy?e.clone():e}if(n.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${n.join(", ")}.`);let a=Object.keys(s).length,i=e.inputNames.length;if(a>i){let t=Object.keys(s).filter(s=>!e.inputNames.includes(s));console.warn(`WARNING: Too many inputs were provided (${a} > ${i}). The following inputs will be ignored: "${t.join(", ")}".`)}return t}(e,s);try{let s=await e.run(t);return s=function e(s){for(let t in s)s[t]instanceof _?s[t]=new r.es(s[t]):"object"==typeof s[t]&&e(s[t]);return s}(s)}catch(e){throw console.error(`An error occurred during model execution: "${e}".`),console.error("Inputs given to model:",t),e}}function x(e,s){let t=e.config.pad_token_id??null,n=e.config.eos_token_id??null;(0,a.Wy)(n)&&(n=[n]);let i=-1!==s.indexOf(t),o=null===n||!n.includes(t);if(!i||!o)return(0,r.r6)(s);{let e=BigInt64Array.from(s.data.map(e=>e!=t));return new r.es("int64",e,s.dims)}}function y(e,s,t){if(!e.inputNames.includes("position_ids"))return;let n=new BigInt64Array(s.attention_mask.data.length);for(let e=0;e<s.attention_mask.dims[0];++e){let t=e*s.attention_mask.dims[1],a=BigInt(0);for(let e=0;e<s.attention_mask.dims[1];++e){let i=t+e;0n===s.attention_mask.data[i]?n[i]=BigInt(1):(n[i]=a,a+=s.attention_mask.data[i])}}s.position_ids=new r.es("int64",n,s.attention_mask.dims),t&&(s.position_ids=s.position_ids.slice(null,-1).unsqueeze_(-1))}function M(e){return new r.es("bool",[e],[1])}async function k(e,s){let{encoder_outputs:t,past_key_values:n}=s;t||(t=(await C(e,s)).last_hidden_state);let a={input_ids:s.decoder_input_ids,encoder_hidden_states:t},i=!!n;e.decoder_merged_session.inputNames.includes("use_cache_branch")&&(a.use_cache_branch=M(i)),e.decoder_merged_session.inputNames.includes("encoder_attention_mask")&&(a.encoder_attention_mask=s.attention_mask),y(e.decoder_merged_session,a,i),e.addPastKeyValues(a,n);let o=await w(e.decoder_merged_session,a);return new ih({logits:o.logits,past_key_values:n=e.getPastKeyValues(o,n),encoder_outputs:t,...e.getAttentions(o)})}function b(e,s,t,n){let a=[],i=0,o=e.requires_attention_mask??!0,l=t.decoder_input_ids??t.decoder_start_token_id??t.bos_token_id??t.eos_token_id;for(let t of(l instanceof r.es?l=l.tolist().flat():Array.isArray(l)||(l=[l]),s)){t.dims=[1,...t.dims];let s={inputs:t,encoder_outputs:null,prev_model_outputs:null,output_token_ids:l,done:!1,score:0,id:i++};o&&(s.attention_mask=x(e,t)),a.push(s)}return a}async function v(e,s){let t=e.main_input_name,n=s.output_token_ids;s.prev_model_outputs&&(n=n.slice(-1));let a={[t]:s.inputs,decoder_input_ids:function(e){if(e instanceof r.es)return e;if(0===e.length)throw Error("items must be non-empty");if(!Array.isArray(e[0]))return new r.es("int64",BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length]);if(e.some(s=>s.length!==e[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new r.es("int64",BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}(n),encoder_outputs:s.encoder_outputs,past_key_values:s.prev_model_outputs?.past_key_values};s.attention_mask&&(a.attention_mask=s.attention_mask);let i=await e.forward(a);return s.prev_model_outputs=i,s.encoder_outputs=i.encoder_outputs,i}function S(e,s){e.output_token_ids=[...e.output_token_ids,s]}async function C(e,s){let t=Object.create(null);for(let n of e.session.inputNames)t[n]=s[n];return e.session.inputNames.includes("token_type_ids")&&!t.token_type_ids&&(t.token_type_ids=new r.es("int64",new BigInt64Array(t.input_ids.data.length),t.input_ids.dims)),await w(e.session,t)}async function F(e,s){let{input_ids:t,past_key_values:n,attention_mask:a}=s,i={input_ids:t,attention_mask:a??x(e,t)},o=!!n;e.session.inputNames.includes("use_cache_branch")&&(i.use_cache_branch=M(o)),y(e.session,i,o),e.addPastKeyValues(i,n);let r=await w(e.session,i);return{logits:r.logits,past_key_values:n=e.getPastKeyValues(r,n)}}function L(e,s,t,n,a){let i=[],o=0;for(let t of s){let s,r=t.tolist().map(Number);t.dims=[1,...t.dims],a?(s=a[o]).dims=[1,...s.dims]:s=x(e,t);let l={input:t,model_input_ids:t,attention_mask:s,prev_model_outputs:null,output_token_ids:r,num_output_tokens:n,done:!1,score:0,id:o++};i.push(l)}return i}async function A(e,s){let t=new BigInt64Array(s.output_token_ids.length).fill(1n),n={input_ids:s.model_input_ids,attention_mask:new r.es("int64",t,[1,t.length]),past_key_values:s.prev_model_outputs?.past_key_values},a=await e.forward(n);return s.prev_model_outputs=a,a}function P(e,s){e.output_token_ids=[...e.output_token_ids,s],e.model_input_ids=new r.es("int64",[BigInt(s)],[1,1])}class E extends a.Ag{main_input_name="input_ids";constructor(e,s){super(),this.config=e,this.session=s;let t=f.get(this.constructor),n=m.get(t);this.can_generate=!1,this._runBeam=null,this._getStartBeams=null,this._updateBeam=null,this._forward=null,n===h.DecoderOnly?(this.can_generate=!0,this._runBeam=A,this._getStartBeams=L,this._updateBeam=P,this._forward=F):n===h.Seq2Seq||n===h.Vision2Seq?(this.can_generate=!0,this._runBeam=v,this._getStartBeams=b,this._updateBeam=S,this._forward=k):(h.EncoderDecoder,this._forward=C)}async dispose(){let e=[];for(let s of Object.keys(this)){let t=this[s];t instanceof d&&e.push(t.handler.dispose())}return await Promise.all(e)}static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:o=null,local_files_only:r=!1,revision:l="main",model_file_name:c=null}={}){let d,_={quantized:s,progress_callback:t,config:a,cache_dir:o,local_files_only:r,revision:l,model_file_name:c},u=f.get(this),p=m.get(u);return p===h.DecoderOnly?d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.Seq2Seq||p===h.Vision2Seq?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.MaskGeneration?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"vision_encoder",_),g(e,"prompt_encoder_mask_decoder",_)]):p===h.EncoderDecoder?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_)]):(p!==h.EncoderOnly&&console.warn(`Model type for '${u??a?.model_type}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`),d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"model",_)])),new this(...d)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}_get_logits_processor(e,s,t=null){let n=new o.Jm;if(null!==e.repetition_penalty&&1!==e.repetition_penalty&&n.push(new o.Jj(e.repetition_penalty)),null!==e.no_repeat_ngram_size&&e.no_repeat_ngram_size>0&&n.push(new o.jF(e.no_repeat_ngram_size)),null!==e.bad_words_ids&&n.push(new o.AE(e.bad_words_ids,e.eos_token_id)),null!==e.min_length&&null!==e.eos_token_id&&e.min_length>0&&n.push(new o.ez(e.min_length,e.eos_token_id)),null!==e.min_new_tokens&&null!==e.eos_token_id&&e.min_new_tokens>0&&n.push(new o.CJ(s,e.min_new_tokens,e.eos_token_id)),null!==e.forced_bos_token_id&&n.push(new o.C9(e.forced_bos_token_id)),null!==e.forced_eos_token_id&&n.push(new o.dZ(e.max_length,e.forced_eos_token_id)),null!==e.begin_suppress_tokens){let t=s>1||null===e.forced_bos_token_id?s:s+1;null!==e.forced_decoder_ids&&(t+=e.forced_decoder_ids[e.forced_decoder_ids.length-1][0]),n.push(new o.GU(e.begin_suppress_tokens,t))}return null!==e.forced_decoder_ids&&n.push(new o.E(e.forced_decoder_ids)),null!==t&&n.extend(t),n}_get_generation_config(e){let s=new o.aP(this.config);return"generation_config"in this&&Object.assign(s,this.generation_config),null!==e&&Object.assign(s,e),s}async generate(e,s=null,t=null,{inputs_attention_mask:n=null}={}){let i;if(!this.can_generate){let e=f.get(this.constructor),s=`The current model class (${e}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`,t=this.config.model_type,n=aT.get(t)??aB.get(t)??aL.get(t)??aq.get(t);throw n&&(s+=` Please use the following class instead: '${n[0]}'`),Error(s)}if(!(e instanceof r.es)&&!(0,a.fU)(e)&&!Array.isArray(e))throw Error(`\`inputs\` must be a Tensor, TypedArray, or Array, but is "${e.constructor.name}".`);if(this.config.is_encoder_decoder)i=0;else if(0===(i=e instanceof r.es?e.dims.at(-1):e.length))throw Error("Must supply a non-empty array of input token ids.");s=this._get_generation_config(s),t=t??new o.Jm,t=this._get_logits_processor(s,i,t);let l=s.eos_token_id;null===l||Array.isArray(l)||(l=[l]);let c=1,d=1+(s.max_new_tokens??1/0),_=Number.isInteger(s.max_length)&&(s.max_new_tokens??null)===null,u=o.Z4.getSampler(s),h=this.getStartBeams(e,s,c,n);for(;h.some(e=>!e.done)&&c<d;){let e=[];for(let n of h){if(n.done){e.push(n);continue}if(_&&n.output_token_ids.length>=s.max_length){n.done=!0,e.push(n);continue}let a=await this.runBeam(n);s.output_attentions&&this.addAttentionsToBeam(n,a),s.output_scores;let i=a.logits.slice(null,-1,null);for(let[s,a]of(t(n.output_token_ids,i),u(i))){let t={...n};this.updateBeam(t,s),t.score+=a,l&&l.includes(s)&&(t.done=!0),e.push(t)}}++c,h=(e=this.groupBeams(e).map(e=>e.sort((e,s)=>s.score-e.score).slice(0,s.num_beams))).flat(),s.callback_function&&s.callback_function(h)}let m=this.groupBeams(h),p=e=>m.map(t=>s.num_return_sequences>1?t.slice(0,s.num_return_sequences).map(s=>s[e]):[t[0][e]]).flat(),g=p("output_token_ids");return s.return_dict_in_generate?{sequences:g,decoder_attentions:p("decoder_attentions"),cross_attentions:p("cross_attentions")}:g}addAttentionsToBeam(e,s){if(this.config.is_encoder_decoder){if(!s.cross_attentions||0===s.cross_attentions.length)throw Error("`output_attentions` is true, but the model did not produce cross-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.cross_attentions||(e.cross_attentions=[]),e.cross_attentions.push(s.cross_attentions)}if(!s.decoder_attentions||0===s.decoder_attentions.length)throw Error("`output_attentions` is true, but the model did not produce decoder-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.decoder_attentions||(e.decoder_attentions=[]),e.decoder_attentions.push(s.decoder_attentions)}groupBeams(e){let s=Object.create(null);for(let t of e)void 0===s[t.id]?s[t.id]=[t]:s[t.id].push(t);return Object.values(s)}getPastKeyValues(e,s){let t=Object.create(null);for(let n in e)if(n.startsWith("present")){let a=n.replace("present","past_key_values");s&&n.includes("encoder")?t[a]=s[a]:t[a]=e[n]}return t}getAttentions(e){let s=Object.create(null);for(let t of["cross_attentions","decoder_attentions"]){let n=[];for(let s in e)s.startsWith(t)&&(n[s.split(".").pop()]=e[s]);s[t]=n}return s}addPastKeyValues(e,s){if(s)Object.assign(e,s);else if(this.config.is_encoder_decoder&&(this.add_encoder_pkv??!0)){let s=[1,this.num_encoder_heads,0,this.encoder_dim_kv],t=[1,this.num_decoder_heads,0,this.decoder_dim_kv];for(let n=0;n<this.num_decoder_layers;++n)e[`past_key_values.${n}.encoder.key`]=new r.es("float32",[],s),e[`past_key_values.${n}.encoder.value`]=new r.es("float32",[],s),e[`past_key_values.${n}.decoder.key`]=new r.es("float32",[],t),e[`past_key_values.${n}.decoder.value`]=new r.es("float32",[],t)}else if("falcon"===this.config.model_type){let s=[1*this.num_heads,0,this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key`]=new r.es("float32",[],s),e[`past_key_values.${t}.value`]=new r.es("float32",[],s)}else if(this.config.multi_query){let s=[1*this.num_heads,0,2*this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key_value`]=new r.es("float32",[],s)}else if("bloom"===this.config.model_type){let s=[1*this.num_heads,this.dim_kv,0],t=[1*this.num_heads,0,this.dim_kv];for(let n=0;n<this.num_layers;++n)e[`past_key_values.${n}.key`]=new r.es("float32",[],s),e[`past_key_values.${n}.value`]=new r.es("float32",[],t)}else{let s=[1,this.num_heads,0,this.dim_kv];for(let t=0;t<this.num_layers;++t)e[`past_key_values.${t}.key`]=new r.es("float32",[],s),e[`past_key_values.${t}.value`]=new r.es("float32",[],s)}}getStartBeams(e,s,t,n){return this._getStartBeams(this,e,s,t,n)}async runBeam(e){return await this._runBeam(this,e)}updateBeam(e,s){return this._updateBeam(e,s)}}class O{}class B extends E{}class T extends B{}class D extends B{async _call(e){return new iw(await super._call(e))}}class I extends B{async _call(e){return new im(await super._call(e))}}class q extends B{async _call(e){return new ig(await super._call(e))}}class N extends B{async _call(e){return new ix(await super._call(e))}}class G extends E{}class V extends G{}class z extends E{}class j extends z{}class $ extends z{async _call(e){return new iw(await super._call(e))}}class W extends z{async _call(e){return new im(await super._call(e))}}class R extends z{async _call(e){return new ig(await super._call(e))}}class Q extends z{async _call(e){return new ix(await super._call(e))}}class U extends E{}class X extends U{}class K extends U{async _call(e){return new iw(await super._call(e))}}class H extends U{async _call(e){return new im(await super._call(e))}}class J extends U{async _call(e){return new ig(await super._call(e))}}class Z extends U{async _call(e){return new ix(await super._call(e))}}class Y extends E{}class ee extends Y{}class es extends Y{async _call(e){return new iw(await super._call(e))}}class et extends Y{async _call(e){return new im(await super._call(e))}}class en extends Y{async _call(e){return new ig(await super._call(e))}}class ea extends Y{async _call(e){return new ix(await super._call(e))}}class ei extends E{}class eo extends ei{}class er extends ei{async _call(e){return new iw(await super._call(e))}}class el extends ei{async _call(e){return new im(await super._call(e))}}class ec extends ei{async _call(e){return new ig(await super._call(e))}}class ed extends ei{async _call(e){return new ix(await super._call(e))}}class e_ extends E{}class eu extends e_{}class eh extends e_{async _call(e){return new iw(await super._call(e))}}class em extends e_{async _call(e){return new im(await super._call(e))}}class ep extends e_{async _call(e){return new ig(await super._call(e))}}class ef extends e_{async _call(e){return new ix(await super._call(e))}}class eg extends E{}class ew extends eg{}class ex extends eg{async _call(e){return new iw(await super._call(e))}}class ey extends eg{async _call(e){return new im(await super._call(e))}}class eM extends eg{async _call(e){return new ig(await super._call(e))}}class ek extends eg{async _call(e){return new ix(await super._call(e))}}class eb extends E{}class ev extends eb{}class eS extends eb{async _call(e){return new im(await super._call(e))}}class eC extends eb{async _call(e){return new ig(await super._call(e))}}class eF extends eb{async _call(e){return new ix(await super._call(e))}}class eL extends eb{async _call(e){return new iw(await super._call(e))}}class eA extends E{}class eP extends eA{}class eE extends eA{async _call(e){return new iw(await super._call(e))}}class eO extends eA{async _call(e){return new im(await super._call(e))}}class eB extends eA{async _call(e){return new ig(await super._call(e))}}class eT extends E{}class eD extends eT{}class eI extends eT{async _call(e){return new iw(await super._call(e))}}class eq extends eT{async _call(e){return new im(await super._call(e))}}class eN extends eT{async _call(e){return new ix(await super._call(e))}}class eG extends E{}class eV extends eG{}class ez extends eG{async _call(e){return new iw(await super._call(e))}}class ej extends eG{async _call(e){return new im(await super._call(e))}}class e$ extends eG{async _call(e){return new ig(await super._call(e))}}class eW extends eG{async _call(e){return new ix(await super._call(e))}}class eR extends E{}class eQ extends eR{}class eU extends eR{async _call(e){return new iw(await super._call(e))}}class eX extends eR{async _call(e){return new im(await super._call(e))}}class eK extends eR{async _call(e){return new ix(await super._call(e))}}class eH extends E{}class eJ extends eH{}class eZ extends eH{async _call(e){return new im(await super._call(e))}}class eY extends eH{async _call(e){return new ix(await super._call(e))}}class e2 extends eH{async _call(e){return new iw(await super._call(e))}}class e0 extends E{}class e1 extends e0{}class e4 extends e0{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class e3 extends E{}class e5 extends e3{}class e6 extends e3{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class e7 extends E{}class e9 extends e7{}class e8 extends e7{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.num_decoder_layers,this.num_decoder_heads=this.config.num_heads,this.decoder_dim_kv=this.config.d_kv,this.num_encoder_layers=this.config.num_layers,this.num_encoder_heads=this.config.num_heads,this.encoder_dim_kv=this.config.d_kv}}class se extends E{}class ss extends se{}class st extends se{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sn extends se{async _call(e){return new im(await super._call(e))}}class sa extends E{}class si extends sa{}class so extends sa{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sr extends sa{async _call(e){return new im(await super._call(e))}}class sl extends sa{constructor(e,s,t){super(e,s),this.generation_config=t,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sc extends E{}class sd extends sc{}class s_ extends sc{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class su extends E{}class sh extends su{}class sm extends su{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class sp extends E{}class sf extends sp{}class sg extends sp{async _call(e){return new iw(await super._call(e))}}class sw extends sp{async _call(e){return new im(await super._call(e))}}class sx extends sp{async _call(e){return new ig(await super._call(e))}}class sy extends sp{async _call(e){return new ix(await super._call(e))}}class sM extends E{}class sk extends sM{}class sb extends sM{async _call(e){return new iw(await super._call(e))}}class sv extends sM{async _call(e){return new im(await super._call(e))}}class sS extends sM{async _call(e){return new ig(await super._call(e))}}class sC extends sM{async _call(e){return new ix(await super._call(e))}}class sF extends E{}class sL extends sF{}class sA extends sF{async _call(e){return new iw(await super._call(e))}}class sP extends sF{async _call(e){return new im(await super._call(e))}}class sE extends sF{async _call(e){return new ig(await super._call(e))}}class sO extends sF{async _call(e){return new ix(await super._call(e))}}class sB extends E{}class sT extends sB{}class sD extends sB{}class sI extends E{}class sq extends sI{}class sN extends sI{requires_attention_mask=!1;main_input_name="input_features";constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}async generate(e,s=null,t=null){if(s=this._get_generation_config(s),s.return_timestamps??=!1,s.return_timestamps&&(t=[new o.Pg(s)]),s.return_token_timestamps&&(s.output_attentions=!0,s.return_dict_in_generate=!0,"translate"===s.task&&console.warn("Token-level timestamps may not be reliable for task 'translate'."),!s.alignment_heads))throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");let n=await super.generate(e,s,t);return s.return_token_timestamps&&s.alignment_heads&&(n.token_timestamps=this._extract_token_timestamps(n,s.alignment_heads,s.num_frames)),n}_extract_token_timestamps(e,s,t=null,n=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");let i=this.config.median_filter_width;void 0===i&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let o=e.cross_attentions.map(e=>{let n=Array.from({length:this.config.decoder_layers},(s,t)=>(0,r.d3)(e.map(e=>e[t]),2)),a=(0,r.kn)(s.map(([e,s])=>t?n[e].slice(null,s,null,[0,t]):n[e].slice(null,s)));a=a.transpose(1,0,2,3);let[o,l]=(0,r.f3)(a,-2,0,!0),d=a.clone();for(let e=0;e<d.dims[0];++e){let s=d[e];for(let t=0;t<s.dims[0];++t){let n=s[t],a=o[e][t][0],r=l[e][t][0];for(let e=0;e<n.dims[0];++e){let s=n[e];for(let e=0;e<s.data.length;++e)s.data[e]=(s.data[e]-r.data[e])/a.data[e];s.data.set((0,c.qCb)(s.data,i))}}}return(0,r.J6)(d,1)}),l=[e.sequences.length,e.sequences[0].length],d=new r.es("float32",new Float32Array(l[0]*l[1]),l);for(let e=0;e<l[0];++e){let s=o[e].neg().squeeze_(0),[t,i]=(0,r.Ks)(s),l=Array.from({length:t.length-1},(e,s)=>t[s+1]-t[s]),c=(0,a.eG)([1],l).map(e=>!!e),_=[];for(let e=0;e<c.length;++e)c[e]&&_.push(i[e]*n);d[e].data.set(_,1)}return d}}class sG extends E{main_input_name="pixel_values";constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n;let a=this.config.encoder,i=this.config.decoder,o=a.model_type;(aS.get(o)??aC.get(o))||console.warn(`Model type for encoder '${o}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`);let r=aT.get(i.model_type);if(!r)throw Error(`Unable to construct \`VisionEncoderDecoder\` due to unsupported decoder: "${this.config.decoder.model_type}"`);let l=new r[1](i,t,n);this.add_encoder_pkv="num_decoder_layers"in l,this.add_encoder_pkv?(this.num_decoder_layers=l.num_decoder_layers,this.num_decoder_heads=l.num_decoder_heads,this.decoder_dim_kv=l.decoder_dim_kv,this.num_encoder_layers=l.num_encoder_layers,this.num_encoder_heads=l.num_encoder_heads,this.encoder_dim_kv=l.encoder_dim_kv):(this.num_layers=l.num_layers,this.num_heads=l.num_heads,this.dim_kv=l.dim_kv)}}class sV extends E{}class sz extends sV{}class sj extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class s$ extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="vision_model",super.from_pretrained(e,s)}}class sW extends E{}class sR extends sW{}class sQ extends sW{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class sU extends sV{static async from_pretrained(e,s={}){return s.model_file_name??="vision_model",super.from_pretrained(e,s)}}class sX extends E{}class sK extends sX{}class sH extends E{}class sJ extends sH{}class sZ extends sH{}class sY extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class s2 extends sY{}class s0 extends sY{}class s1 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_heads,this.num_layers=this.config.num_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class s4 extends s1{}class s3 extends s1{}class s5 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class s6 extends s5{}class s7 extends s5{}class s9 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class s8 extends s9{}class te extends s9{}class ts extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class tt extends ts{}class tn extends ts{}class ta extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.n_embd/this.num_heads}}class ti extends ta{}class to extends ta{}class tr extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads??this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class tl extends tr{}class tc extends tr{}class td extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads??this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class t_ extends td{}class tu extends td{}class th extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class tm extends th{}class tp extends th{}class tf extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_head,this.num_layers=this.config.n_layer,this.dim_kv=this.config.hidden_size/this.num_heads}}class tg extends tf{}class tw extends tf{}class tx extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.n_heads,this.num_layers=this.config.n_layers,this.dim_kv=this.config.d_model/this.num_heads}}class ty extends tx{}class tM extends tx{}class tk extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class tb extends tk{}class tv extends tk{}class tS extends E{}class tC extends tS{}class tF extends tS{async _call(e){return new im(await super._call(e))}}class tL extends E{}class tA extends tL{async _call(e){return new iM(await super._call(e))}}class tP extends E{}class tE extends tP{}class tO extends tP{async _call(e){return new im(await super._call(e))}}class tB extends E{}class tT extends tB{}class tD extends tB{}class tI extends E{}class tq extends tI{}class tN extends tI{}class tG extends E{}class tV extends tG{}class tz extends tG{async _call(e){return new im(await super._call(e))}}class tj extends E{}class t$ extends tj{}class tW extends tj{async _call(e){return new tQ(await super._call(e))}}class tR extends tj{async _call(e){return new tU(await super._call(e))}}class tQ extends O{constructor({logits:e,pred_boxes:s}){super(),this.logits=e,this.pred_boxes=s}}class tU extends O{constructor({logits:e,pred_boxes:s,pred_masks:t}){super(),this.logits=e,this.pred_boxes=s,this.pred_masks=t}}class tX extends E{}class tK extends tX{}class tH extends tX{async _call(e){return new tJ(await super._call(e))}}class tJ extends tQ{}class tZ extends E{}class tY extends tZ{}class t2 extends tZ{async _call(e){return new im(await super._call(e))}}class t0 extends E{}class t1 extends t0{}class t4 extends t0{async _call(e){return new im(await super._call(e))}}class t3 extends E{}class t5 extends t3{}class t6 extends t3{async _call(e){return new im(await super._call(e))}}class t7 extends E{}class t9 extends t7{}class t8 extends t7{}class ne extends E{}class ns extends ne{}class nt extends ne{}class nn extends E{}class na extends nn{}class ni extends E{}class no extends ni{}class nr extends ni{}class nl extends E{}class nc extends nl{}class nd extends E{}class n_ extends nd{}class nu extends nd{async _call(e){return new im(await super._call(e))}}class nh extends E{}class nm extends nh{}class np extends nh{async _call(e){return new im(await super._call(e))}}class nf extends E{}class ng extends nf{}class nw extends nf{async _call(e){return new im(await super._call(e))}}class nx extends E{}class ny extends nx{}class nM extends nx{async _call(e){return new nk(await super._call(e))}}class nk extends O{constructor({logits:e,pred_boxes:s}){super(),this.logits=e,this.pred_boxes=s}}class nb extends E{}class nv extends nb{constructor(e,s,t){super(e,s),this.prompt_encoder_mask_decoder=t}async get_image_embeddings({pixel_values:e}){return await C(this,{pixel_values:e})}async forward(e){if(e.image_embeddings&&e.image_positional_embeddings||(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels){let s=e.input_points.dims.slice(0,-1),t=s.reduce((e,s)=>e*s,1);e.input_labels=new r.es("int64",new BigInt64Array(t).fill(1n),s)}return await w(this.prompt_encoder_mask_decoder,{input_points:e.input_points,input_labels:e.input_labels,image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings})}async _call(e){return new nS(await super._call(e))}}class nS extends O{constructor({iou_scores:e,pred_masks:s}){super(),this.iou_scores=e,this.pred_masks=s}}class nC extends E{}class nF extends nC{}class nL extends nC{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nA extends E{}class nP extends nA{}class nE extends nA{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nO extends E{}class nB extends nO{}class nT extends nO{async _call(e){return new iy(await super._call(e))}}class nD extends nO{async _call(e){return new im(await super._call(e))}}class nI extends nO{async _call(e){return new ig(await super._call(e))}}class nq extends E{}class nN extends nq{}class nG extends nq{async _call(e){return new iy(await super._call(e))}}class nV extends nq{async _call(e){return new im(await super._call(e))}}class nz extends E{}class nj extends nz{}class n$ extends nz{async _call(e){return new iy(await super._call(e))}}class nW extends nz{async _call(e){return new im(await super._call(e))}}class nR extends nz{async _call(e){return new ig(await super._call(e))}}class nQ extends E{}class nU extends nQ{}class nX extends nQ{async _call(e){return new iy(await super._call(e))}}class nK extends nQ{async _call(e){return new im(await super._call(e))}}class nH extends nO{}class nJ extends nO{async _call(e){return new iy(await super._call(e))}}class nZ extends nO{async _call(e){return new im(await super._call(e))}}class nY extends E{}class n2 extends nY{}class n0 extends nY{async _call(e){return new iy(await super._call(e))}}class n1 extends nY{async _call(e){return new im(await super._call(e))}}class n4 extends nY{async _call(e){return new ip(await super._call(e))}}class n3 extends nY{async _call(e){return new ig(await super._call(e))}}class n5 extends E{}class n6 extends n5{}class n7 extends n5{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.hidden_size/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.hidden_size/this.num_encoder_heads}async generate_speech(e,s,{threshold:t=.5,minlenratio:n=0,maxlenratio:a=20,vocoder:i=null}={}){let{encoder_outputs:o,encoder_attention_mask:l}=await C(this,{input_ids:e}),c=o.dims[1]/this.config.reduction_factor,d=Math.floor(c*a),_=Math.floor(c*n),u=this.config.num_mel_bins,h=[],m=null,p=null,f=0;for(;;){++f;let e={use_cache_branch:M(!!p),output_sequence:p?p.output_sequence_out:new r.es("float32",new Float32Array(u),[1,1,u]),encoder_attention_mask:l,speaker_embeddings:s,encoder_hidden_states:o};this.addPastKeyValues(e,m),p=await w(this.decoder_merged_session,e),m=this.getPastKeyValues(p,m);let{prob:n,spectrum:a}=p;if(h.push(a),f>=_&&(Array.from(n.data).filter(e=>e>=t).length>0||f>=d))break}let g=(0,r.d3)(h),{waveform:x}=await w(i.session,{spectrogram:g});return{spectrogram:g,waveform:x}}}class n9 extends E{main_input_name="spectrogram"}class n8 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_encoder_layers=this.num_decoder_layers=this.config.decoder_layers,this.num_encoder_heads=this.num_decoder_heads=this.config.decoder_attention_heads,this.encoder_dim_kv=this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads}}class ae extends n8{}class as extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class at extends as{}class an extends as{}class aa extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class ai extends aa{}class ao extends aa{}class ar extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class al extends ar{}class ac extends ar{}class ad extends E{}class a_ extends ad{}class au extends ad{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class ah extends ad{static async from_pretrained(e,s={}){return s.model_file_name??="audio_model",super.from_pretrained(e,s)}}class am extends E{}class ap extends am{async _call(e){return new ik(await super._call(e))}}class af extends E{}class ag extends af{}class aw extends af{}class ax extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class ay extends ax{}class aM extends E{}class ak extends aM{}class ab extends aM{async _call(e){return new im(await super._call(e))}}class av{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:i=null,local_files_only:o=!1,revision:r="main",model_file_name:l=null}={}){let c={quantized:s,progress_callback:t,config:a,cache_dir:i,local_files_only:o,revision:r,model_file_name:l};if(a=await n.z.from_pretrained(e,c),c.config||(c.config=a),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);for(let s of this.MODEL_CLASS_MAPPINGS){let t=s.get(a.model_type);if(t)return await t[1].from_pretrained(e,c)}if(this.BASE_IF_FAIL)return console.warn(`Unknown model class "${a.model_type}", attempting to construct from base class.`),await E.from_pretrained(e,c);throw Error(`Unsupported model type: ${a.model_type}`)}}let aS=new Map([["bert",["BertModel",T]],["nomic_bert",["NomicBertModel",V]],["roformer",["RoFormerModel",j]],["electra",["ElectraModel",ee]],["esm",["EsmModel",eP]],["convbert",["ConvBertModel",X]],["camembert",["CamembertModel",eo]],["deberta",["DebertaModel",eu]],["deberta-v2",["DebertaV2Model",ew]],["mpnet",["MPNetModel",eV]],["albert",["AlbertModel",eJ]],["distilbert",["DistilBertModel",ev]],["roberta",["RobertaModel",sf]],["xlm",["XLMModel",sk]],["xlm-roberta",["XLMRobertaModel",sL]],["clap",["ClapModel",a_]],["clip",["CLIPModel",sz]],["clipseg",["CLIPSegModel",sJ]],["chinese_clip",["ChineseCLIPModel",sK]],["siglip",["SiglipModel",sR]],["mobilebert",["MobileBertModel",eD]],["squeezebert",["SqueezeBertModel",eQ]],["wav2vec2",["Wav2Vec2Model",nB]],["wav2vec2-bert",["Wav2Vec2BertModel",nU]],["unispeech",["UniSpeechModel",nN]],["unispeech-sat",["UniSpeechSatModel",nj]],["hubert",["HubertModel",nH]],["wavlm",["WavLMModel",n2]],["audio-spectrogram-transformer",["ASTModel",sT]],["vits",["VitsModel",ap]],["detr",["DetrModel",t$]],["table-transformer",["TableTransformerModel",tK]],["vit",["ViTModel",tC]],["mobilevit",["MobileViTModel",tE]],["owlvit",["OwlViTModel",tT]],["owlv2",["Owlv2Model",tq]],["beit",["BeitModel",tV]],["deit",["DeiTModel",tY]],["convnext",["ConvNextModel",n_]],["convnextv2",["ConvNextV2Model",nm]],["dinov2",["Dinov2Model",ng]],["resnet",["ResNetModel",t1]],["swin",["SwinModel",t5]],["swin2sr",["Swin2SRModel",t9]],["donut-swin",["DonutSwinModel",nc]],["yolos",["YolosModel",ny]],["dpt",["DPTModel",ns]],["glpn",["GLPNModel",no]],["hifigan",["SpeechT5HifiGan",n9]],["efficientnet",["EfficientNetModel",ak]]]),aC=new Map([["t5",["T5Model",e1]],["longt5",["LongT5Model",e5]],["mt5",["MT5Model",e9]],["bart",["BartModel",ss]],["mbart",["MBartModel",si]],["marian",["MarianModel",nF]],["whisper",["WhisperModel",sq]],["m2m_100",["M2M100Model",nP]],["blenderbot",["BlenderbotModel",sd]],["blenderbot-small",["BlenderbotSmallModel",sh]]]),aF=new Map([["bloom",["BloomModel",tg]],["gpt2",["GPT2Model",s2]],["gptj",["GPTJModel",s8]],["gpt_bigcode",["GPTBigCodeModel",tt]],["gpt_neo",["GPTNeoModel",s4]],["gpt_neox",["GPTNeoXModel",s6]],["codegen",["CodeGenModel",ti]],["llama",["LlamaModel",tl]],["qwen2",["Qwen2Model",t_]],["phi",["PhiModel",tm]],["mpt",["MptModel",ty]],["opt",["OPTModel",tb]],["mistral",["MistralModel",at]],["starcoder2",["Starcoder2Model",ai]],["falcon",["FalconModel",al]]]),aL=new Map([["speecht5",["SpeechT5ForSpeechToText",n6]],["whisper",["WhisperForConditionalGeneration",sN]]]),aA=new Map([["speecht5",["SpeechT5ForTextToSpeech",n7]]]),aP=new Map([["vits",["VitsModel",ap]]]),aE=new Map([["bert",["BertForSequenceClassification",I]],["roformer",["RoFormerForSequenceClassification",W]],["electra",["ElectraForSequenceClassification",et]],["esm",["EsmForSequenceClassification",eO]],["convbert",["ConvBertForSequenceClassification",H]],["camembert",["CamembertForSequenceClassification",el]],["deberta",["DebertaForSequenceClassification",em]],["deberta-v2",["DebertaV2ForSequenceClassification",ey]],["mpnet",["MPNetForSequenceClassification",ej]],["albert",["AlbertForSequenceClassification",eZ]],["distilbert",["DistilBertForSequenceClassification",eS]],["roberta",["RobertaForSequenceClassification",sw]],["xlm",["XLMForSequenceClassification",sv]],["xlm-roberta",["XLMRobertaForSequenceClassification",sP]],["bart",["BartForSequenceClassification",sn]],["mbart",["MBartForSequenceClassification",sr]],["mobilebert",["MobileBertForSequenceClassification",eq]],["squeezebert",["SqueezeBertForSequenceClassification",eX]]]),aO=new Map([["bert",["BertForTokenClassification",q]],["roformer",["RoFormerForTokenClassification",R]],["electra",["ElectraForTokenClassification",en]],["esm",["EsmForTokenClassification",eB]],["convbert",["ConvBertForTokenClassification",J]],["camembert",["CamembertForTokenClassification",ec]],["deberta",["DebertaForTokenClassification",ep]],["deberta-v2",["DebertaV2ForTokenClassification",eM]],["mpnet",["MPNetForTokenClassification",e$]],["distilbert",["DistilBertForTokenClassification",eC]],["roberta",["RobertaForTokenClassification",sx]],["xlm",["XLMForTokenClassification",sS]],["xlm-roberta",["XLMRobertaForTokenClassification",sE]]]),aB=new Map([["t5",["T5ForConditionalGeneration",e4]],["longt5",["LongT5ForConditionalGeneration",e6]],["mt5",["MT5ForConditionalGeneration",e8]],["bart",["BartForConditionalGeneration",st]],["mbart",["MBartForConditionalGeneration",so]],["marian",["MarianMTModel",nL]],["m2m_100",["M2M100ForConditionalGeneration",nE]],["blenderbot",["BlenderbotForConditionalGeneration",s_]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",sm]]]),aT=new Map([["bloom",["BloomForCausalLM",tw]],["gpt2",["GPT2LMHeadModel",s0]],["gptj",["GPTJForCausalLM",te]],["gpt_bigcode",["GPTBigCodeForCausalLM",tn]],["gpt_neo",["GPTNeoForCausalLM",s3]],["gpt_neox",["GPTNeoXForCausalLM",s7]],["codegen",["CodeGenForCausalLM",to]],["llama",["LlamaForCausalLM",tc]],["qwen2",["Qwen2ForCausalLM",tu]],["phi",["PhiForCausalLM",tp]],["mpt",["MptForCausalLM",tM]],["opt",["OPTForCausalLM",tv]],["mbart",["MBartForCausalLM",sl]],["mistral",["MistralForCausalLM",an]],["starcoder2",["Starcoder2ForCausalLM",ao]],["falcon",["FalconForCausalLM",ac]],["trocr",["TrOCRForCausalLM",ae]],["stablelm",["StableLmForCausalLM",ay]]]),aD=new Map([["bert",["BertForMaskedLM",D]],["roformer",["RoFormerForMaskedLM",$]],["electra",["ElectraForMaskedLM",es]],["esm",["EsmForMaskedLM",eE]],["convbert",["ConvBertForMaskedLM",K]],["camembert",["CamembertForMaskedLM",er]],["deberta",["DebertaForMaskedLM",eh]],["deberta-v2",["DebertaV2ForMaskedLM",ex]],["mpnet",["MPNetForMaskedLM",ez]],["albert",["AlbertForMaskedLM",e2]],["distilbert",["DistilBertForMaskedLM",eL]],["roberta",["RobertaForMaskedLM",sg]],["xlm",["XLMWithLMHeadModel",sb]],["xlm-roberta",["XLMRobertaForMaskedLM",sA]],["mobilebert",["MobileBertForMaskedLM",eI]],["squeezebert",["SqueezeBertForMaskedLM",eU]]]),aI=new Map([["bert",["BertForQuestionAnswering",N]],["roformer",["RoFormerForQuestionAnswering",Q]],["electra",["ElectraForQuestionAnswering",ea]],["convbert",["ConvBertForQuestionAnswering",Z]],["camembert",["CamembertForQuestionAnswering",ed]],["deberta",["DebertaForQuestionAnswering",ef]],["deberta-v2",["DebertaV2ForQuestionAnswering",ek]],["mpnet",["MPNetForQuestionAnswering",eW]],["albert",["AlbertForQuestionAnswering",eY]],["distilbert",["DistilBertForQuestionAnswering",eF]],["roberta",["RobertaForQuestionAnswering",sy]],["xlm",["XLMForQuestionAnswering",sC]],["xlm-roberta",["XLMRobertaForQuestionAnswering",sO]],["mobilebert",["MobileBertForQuestionAnswering",eN]],["squeezebert",["SqueezeBertForQuestionAnswering",eK]]]),aq=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aN=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aG=new Map([["vit",["ViTForImageClassification",tF]],["mobilevit",["MobileViTForImageClassification",tO]],["beit",["BeitForImageClassification",tz]],["deit",["DeiTForImageClassification",t2]],["convnext",["ConvNextForImageClassification",nu]],["convnextv2",["ConvNextV2ForImageClassification",np]],["dinov2",["Dinov2ForImageClassification",nw]],["resnet",["ResNetForImageClassification",t4]],["swin",["SwinForImageClassification",t6]],["segformer",["SegformerForImageClassification",ag]],["efficientnet",["EfficientNetForImageClassification",ab]]]),aV=new Map([["detr",["DetrForObjectDetection",tW]],["table-transformer",["TableTransformerForObjectDetection",tH]],["yolos",["YolosForObjectDetection",nM]]]),az=new Map([["owlvit",["OwlViTForObjectDetection",tD]],["owlv2",["Owlv2ForObjectDetection",tN]]]),aj=new Map([["detr",["DetrForSegmentation",tR]],["clipseg",["CLIPSegForImageSegmentation",sZ]]]),a$=new Map([["segformer",["SegformerForSemanticSegmentation",aw]]]),aW=new Map([["sam",["SamModel",nv]]]),aR=new Map([["wav2vec2",["Wav2Vec2ForCTC",nT]],["wav2vec2-bert",["Wav2Vec2BertForCTC",nX]],["unispeech",["UniSpeechForCTC",nG]],["unispeech-sat",["UniSpeechSatForCTC",n$]],["wavlm",["WavLMForCTC",n0]],["hubert",["HubertForCTC",nJ]]]),aQ=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",nD]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",nK]],["unispeech",["UniSpeechForSequenceClassification",nV]],["unispeech-sat",["UniSpeechSatForSequenceClassification",nW]],["wavlm",["WavLMForSequenceClassification",n1]],["hubert",["HubertForSequenceClassification",nZ]],["audio-spectrogram-transformer",["ASTForAudioClassification",sD]]]),aU=new Map([["wavlm",["WavLMForXVector",n4]]]),aX=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",nR]],["wavlm",["WavLMForAudioFrameClassification",n3]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",nI]]]),aK=new Map([["vitmatte",["VitMatteForImageMatting",tA]]]),aH=new Map([["swin2sr",["Swin2SRForImageSuperResolution",t8]]]),aJ=new Map([["dpt",["DPTForDepthEstimation",nt]],["depth_anything",["DepthAnythingForDepthEstimation",na]],["glpn",["GLPNForDepthEstimation",nr]]]),aZ=new Map([["clip",["CLIPVisionModelWithProjection",s$]],["siglip",["SiglipVisionModel",sU]]]),aY=[[aS,h.EncoderOnly],[aC,h.EncoderDecoder],[aF,h.DecoderOnly],[aE,h.EncoderOnly],[aO,h.EncoderOnly],[aB,h.Seq2Seq],[aL,h.Seq2Seq],[aT,h.DecoderOnly],[aD,h.EncoderOnly],[aI,h.EncoderOnly],[aq,h.Vision2Seq],[aG,h.EncoderOnly],[aj,h.EncoderOnly],[a$,h.EncoderOnly],[aK,h.EncoderOnly],[aH,h.EncoderOnly],[aJ,h.EncoderOnly],[aV,h.EncoderOnly],[az,h.EncoderOnly],[aW,h.MaskGeneration],[aR,h.EncoderOnly],[aQ,h.EncoderOnly],[aA,h.Seq2Seq],[aP,h.EncoderOnly],[aU,h.EncoderOnly],[aX,h.EncoderOnly],[aZ,h.EncoderOnly]];for(let[e,s]of aY)for(let[t,n]of e.values())m.set(t,s),f.set(n,t),p.set(t,n);for(let[e,s,t]of[["CLIPTextModelWithProjection",sj,h.EncoderOnly],["SiglipTextModel",sQ,h.EncoderOnly],["ClapTextModelWithProjection",au,h.EncoderOnly],["ClapAudioModelWithProjection",ah,h.EncoderOnly]])m.set(e,t),f.set(s,e),p.set(e,s);class a2 extends av{static MODEL_CLASS_MAPPINGS=aY.map(e=>e[0]);static BASE_IF_FAIL=!0}class a0 extends av{static MODEL_CLASS_MAPPINGS=[aE]}class a1 extends av{static MODEL_CLASS_MAPPINGS=[aO]}class a4 extends av{static MODEL_CLASS_MAPPINGS=[aB]}class a3 extends av{static MODEL_CLASS_MAPPINGS=[aL]}class a5 extends av{static MODEL_CLASS_MAPPINGS=[aA]}class a6 extends av{static MODEL_CLASS_MAPPINGS=[aP]}class a7 extends av{static MODEL_CLASS_MAPPINGS=[aT]}class a9 extends av{static MODEL_CLASS_MAPPINGS=[aD]}class a8 extends av{static MODEL_CLASS_MAPPINGS=[aI]}class ie extends av{static MODEL_CLASS_MAPPINGS=[aq]}class is extends av{static MODEL_CLASS_MAPPINGS=[aG]}class it extends av{static MODEL_CLASS_MAPPINGS=[aj]}class ia extends av{static MODEL_CLASS_MAPPINGS=[a$]}class ii extends av{static MODEL_CLASS_MAPPINGS=[aV]}class io extends av{static MODEL_CLASS_MAPPINGS=[az]}class ir extends av{static MODEL_CLASS_MAPPINGS=[aR]}class il extends av{static MODEL_CLASS_MAPPINGS=[aQ]}class ic extends av{static MODEL_CLASS_MAPPINGS=[aN]}class id extends av{static MODEL_CLASS_MAPPINGS=[aH]}class i_ extends av{static MODEL_CLASS_MAPPINGS=[aJ]}class iu extends av{static MODEL_CLASS_MAPPINGS=[aZ]}class ih extends O{constructor({logits:e,past_key_values:s,encoder_outputs:t,decoder_attentions:n=null,cross_attentions:a=null}){super(),this.logits=e,this.past_key_values=s,this.encoder_outputs=t,this.decoder_attentions=n,this.cross_attentions=a}}class im extends O{constructor({logits:e}){super(),this.logits=e}}class ip extends O{constructor({logits:e,embeddings:s}){super(),this.logits=e,this.embeddings=s}}class ig extends O{constructor({logits:e}){super(),this.logits=e}}class iw extends O{constructor({logits:e}){super(),this.logits=e}}class ix extends O{constructor({start_logits:e,end_logits:s}){super(),this.start_logits=e,this.end_logits=s}}class iy extends O{constructor({logits:e}){super(),this.logits=e}}class iM extends O{constructor({alphas:e}){super(),this.alphas=e}}class ik extends O{constructor({waveform:e,spectrogram:s}){super(),this.waveform=e,this.spectrogram=s}}}}]);
_next/static/chunks/616-4a3447e4a89711ca.js DELETED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/66.deca4787bfb39346.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66],{495:function(){},7147:function(){},1418:function(){},8741:function(){},319:function(){},8386:function(){},3342:function(){},1696:function(a,n,t){"use strict";t.r(n),t.d(n,{default:function(){return M}});var e=t(2281),i=t(9078),r=t(2265),s=t(5377),l=t(9175),_=t(3187),o=t(8030),u=t(1957),c=t(1569),h=t(1378),L=t(1217),d=t(4363),b=t(3370),m=t(4905);let g=a=>{let{type:n,onChange:t,defaultLanguage:i}=a;return(0,e.jsxs)(s.FA,{f:1,ai:"center",children:[(0,e.jsxs)(L.n,{children:[n,": "]}),(0,e.jsxs)(d.Ph,{size:"$4",onValueChange:t,defaultValue:i,children:[(0,e.jsx)(d.Ph.Trigger,{iconAfter:c._,children:(0,e.jsx)(d.Ph.Value,{placeholder:"Languages"})}),(0,e.jsx)(b.Tr,{when:"sm",platform:"touch",children:(0,e.jsxs)(m.yo,{native:!1,modal:!0,dismissOnSnapToBottom:!0,animation:"quick",children:[(0,e.jsx)(m.yo.Frame,{children:(0,e.jsx)(m.yo.ScrollView,{children:(0,e.jsx)(b.Tr.Contents,{})})}),(0,e.jsx)(m.yo.Overlay,{animation:"lazy",enterStyle:{opacity:0},exitStyle:{opacity:0}})]})}),(0,e.jsxs)(d.Ph.Content,{zIndex:2e5,children:[(0,e.jsxs)(d.Ph.ScrollUpButton,{ai:"center",jc:"center",pos:"relative",w:"100%",h:"$3",children:[(0,e.jsx)(s.FA,{zi:10,children:(0,e.jsx)(h.K,{size:20})}),(0,e.jsx)(o.o,{start:[0,0],end:[0,1],fullscreen:!0,colors:["$background","transparent"],br:"$4"})]}),(0,e.jsx)(d.Ph.Viewport,{children:(0,e.jsxs)(d.Ph.Group,{children:[(0,e.jsx)(d.Ph.Label,{children:"Languages"}),Object.entries(j).map((a,n)=>{let[t,i]=a;return(0,e.jsxs)(d.Ph.Item,{index:n,value:i,children:[(0,e.jsx)(d.Ph.ItemText,{children:t}),(0,e.jsx)(d.Ph.ItemIndicator,{ml:"auto",children:(0,e.jsx)(u.J,{size:16})})]},t)})]})}),(0,e.jsxs)(d.Ph.ScrollDownButton,{ai:"center",jc:"center",pos:"relative",w:"100%",h:"$3",children:[(0,e.jsx)(s.FA,{zi:10,children:(0,e.jsx)(c._,{size:20})}),(0,e.jsx)(o.o,{start:[0,0],end:[0,1],fullscreen:!0,colors:["transparent","$background"],br:"$4"})]})]})]})]})},j={"Acehnese (Arabic script)":"ace_Arab","Acehnese (Latin script)":"ace_Latn",Afrikaans:"afr_Latn",Akan:"aka_Latn",Amharic:"amh_Ethi",Armenian:"hye_Armn",Assamese:"asm_Beng",Asturian:"ast_Latn",Awadhi:"awa_Deva","Ayacucho Quechua":"quy_Latn",Balinese:"ban_Latn",Bambara:"bam_Latn","Banjar (Arabic script)":"bjn_Arab","Banjar (Latin script)":"bjn_Latn",Bashkir:"bak_Cyrl",Basque:"eus_Latn",Belarusian:"bel_Cyrl",Bemba:"bem_Latn",Bengali:"ben_Beng",Bhojpuri:"bho_Deva",Bosnian:"bos_Latn",Buginese:"bug_Latn",Bulgarian:"bul_Cyrl",Burmese:"mya_Mymr",Catalan:"cat_Latn",Cebuano:"ceb_Latn","Central Atlas Tamazight":"tzm_Tfng","Central Aymara":"ayr_Latn","Central Kanuri (Arabic script)":"knc_Arab","Central Kanuri (Latin script)":"knc_Latn","Central Kurdish":"ckb_Arab",Chhattisgarhi:"hne_Deva","Chinese (Simplified)":"zho_Hans","Chinese (Traditional)":"zho_Hant",Chokwe:"cjk_Latn","Crimean Tatar":"crh_Latn",Croatian:"hrv_Latn",Czech:"ces_Latn",Danish:"dan_Latn",Dari:"prs_Arab",Dutch:"nld_Latn",Dyula:"dyu_Latn",Dzongkha:"dzo_Tibt","Eastern Panjabi":"pan_Guru","Eastern Yiddish":"ydd_Hebr","Egyptian Arabic":"arz_Arab",English:"eng_Latn",Esperanto:"epo_Latn",Estonian:"est_Latn",Ewe:"ewe_Latn",Faroese:"fao_Latn",Fijian:"fij_Latn",Finnish:"fin_Latn",Fon:"fon_Latn",French:"fra_Latn",Friulian:"fur_Latn",Galician:"glg_Latn",Ganda:"lug_Latn",Georgian:"kat_Geor",German:"deu_Latn",Greek:"ell_Grek",Guarani:"grn_Latn",Gujarati:"guj_Gujr","Haitian Creole":"hat_Latn","Halh Mongolian":"khk_Cyrl",Hausa:"hau_Latn",Hebrew:"heb_Hebr",Hindi:"hin_Deva",Hungarian:"hun_Latn",Icelandic:"isl_Latn",Igbo:"ibo_Latn",Ilocano:"ilo_Latn",Indonesian:"ind_Latn",Irish:"gle_Latn",Italian:"ita_Latn",Japanese:"jpn_Jpan",Javanese:"jav_Latn",Jingpho:"kac_Latn",KabiyΓ¨:"kbp_Latn",Kabuverdianu:"kea_Latn",Kabyle:"kab_Latn",Kamba:"kam_Latn",Kannada:"kan_Knda","Kashmiri (Arabic script)":"kas_Arab","Kashmiri (Devanagari script)":"kas_Deva",Kazakh:"kaz_Cyrl",Khmer:"khm_Khmr",Kikongo:"kon_Latn",Kikuyu:"kik_Latn",Kimbundu:"kmb_Latn",Kinyarwanda:"kin_Latn",Korean:"kor_Hang",Kyrgyz:"kir_Cyrl",Lao:"lao_Laoo",Latgalian:"ltg_Latn",Ligurian:"lij_Latn",Limburgish:"lim_Latn",Lingala:"lin_Latn",Lithuanian:"lit_Latn",Lombard:"lmo_Latn","Luba-Kasai":"lua_Latn",Luo:"luo_Latn",Luxembourgish:"ltz_Latn",Macedonian:"mkd_Cyrl",Magahi:"mag_Deva",Maithili:"mai_Deva",Malayalam:"mal_Mlym",Maltese:"mlt_Latn",Maori:"mri_Latn",Marathi:"mar_Deva","Meitei (Bengali script)":"mni_Beng","Mesopotamian Arabic":"acm_Arab","Minangkabau (Arabic script)":"min_Arab","Minangkabau (Latin script)":"min_Latn",Mizo:"lus_Latn","Modern Standard Arabic (Romanized)":"arb_Latn","Modern Standard Arabic":"arb_Arab","Moroccan Arabic":"ary_Arab",Mossi:"mos_Latn","Najdi Arabic":"ars_Arab",Nepali:"npi_Deva","Nigerian Fulfulde":"fuv_Latn","North Azerbaijani":"azj_Latn","North Levantine Arabic":"apc_Arab","Northern Kurdish":"kmr_Latn","Northern Sotho":"nso_Latn","Northern Uzbek":"uzn_Latn","Norwegian Bokm\xe5l":"nob_Latn","Norwegian Nynorsk":"nno_Latn",Nuer:"nus_Latn",Nyanja:"nya_Latn",Occitan:"oci_Latn",Odia:"ory_Orya",Pangasinan:"pag_Latn",Papiamento:"pap_Latn","Plateau Malagasy":"plt_Latn",Polish:"pol_Latn",Portuguese:"por_Latn",Romanian:"ron_Latn",Rundi:"run_Latn",Russian:"rus_Cyrl",Samoan:"smo_Latn",Sango:"sag_Latn",Sanskrit:"san_Deva",Santali:"sat_Olck",Sardinian:"srd_Latn","Scottish Gaelic":"gla_Latn",Serbian:"srp_Cyrl",Shan:"shn_Mymr",Shona:"sna_Latn",Sicilian:"scn_Latn",Silesian:"szl_Latn",Sindhi:"snd_Arab",Sinhala:"sin_Sinh",Slovak:"slk_Latn",Slovenian:"slv_Latn",Somali:"som_Latn","South Azerbaijani":"azb_Arab","South Levantine Arabic":"ajp_Arab","Southern Pashto":"pbt_Arab","Southern Sotho":"sot_Latn","Southwestern Dinka":"dik_Latn",Spanish:"spa_Latn","Standard Latvian":"lvs_Latn","Standard Malay":"zsm_Latn","Standard Tibetan":"bod_Tibt",Sundanese:"sun_Latn",Swahili:"swh_Latn",Swati:"ssw_Latn",Swedish:"swe_Latn",Tagalog:"tgl_Latn",Tajik:"tgk_Cyrl","Tamasheq (Latin script)":"taq_Latn","Tamasheq (Tifinagh script)":"taq_Tfng",Tamil:"tam_Taml",Tatar:"tat_Cyrl","Ta’izzi-Adeni Arabic":"acq_Arab",Telugu:"tel_Telu",Thai:"tha_Thai",Tigrinya:"tir_Ethi","Tok Pisin":"tpi_Latn","Tosk Albanian":"als_Latn",Tsonga:"tso_Latn",Tswana:"tsn_Latn",Tumbuka:"tum_Latn","Tunisian Arabic":"aeb_Arab",Turkish:"tur_Latn",Turkmen:"tuk_Latn",Twi:"twi_Latn",Ukrainian:"ukr_Cyrl",Umbundu:"umb_Latn",Urdu:"urd_Arab",Uyghur:"uig_Arab",Venetian:"vec_Latn",Vietnamese:"vie_Latn",Waray:"war_Latn",Welsh:"cym_Latn","West Central Oromo":"gaz_Latn","Western Persian":"pes_Arab",Wolof:"wol_Latn",Xhosa:"xho_Latn",Yoruba:"yor_Latn","Yue Chinese":"yue_Hant",Zulu:"zul_Latn"};var p=t(663);let k=a=>{let{text:n,percentage:t}=a;return t=null!=t?t:0,(0,e.jsxs)(s.FA,{h:"$8",ai:"center",gap:"$4",children:[(0,e.jsxs)(L.n,{h:30,o:.5,children:[n," "]}),100!==t&&(0,e.jsx)(p.Ex,{size:"$6",value:t,children:(0,e.jsx)(p.Ex.Indicator,{animation:"bouncy"})})]})},y=()=>{let[a,n]=(0,r.useState)(!0),[t,o]=(0,r.useState)({}),[u,c]=(0,r.useState)(0),[h,L]=(0,r.useState)("Loading model (927MB)..."),[d,b]=(0,r.useState)("T\xf4i y\xeau Việt Nam qu\xea hΖ°Ζ‘ng t\xf4i."),[m,j]=(0,r.useState)("vie_Latn"),[p,y]=(0,r.useState)("eng_Latn"),[x,A]=(0,r.useState)(""),f=(0,r.useRef)(null);(0,r.useEffect)(()=>{var a;null!==(a=f.current)&&void 0!==a||(f.current=(0,i.EUT)("translation","Xenova/nllb-200-distilled-600M",{quantized:!0,progress_callback:a=>{"progress"===a.status&&o(n=>({...n,[a.file]:a}))}}))},[]),(0,r.useEffect)(()=>{n(!0),Object.values(t);let a=0,e=0;for(let n of Object.values(t))a+=n.loaded,e+=n.total;let i=a/e*100;c(i),L(100===i?"Ready!":"Loading model (".concat(i.toFixed(),"% of 927MB)...")),n(!1)},[t]);let S=async()=>{n(!0),L("Translating..."),A("");let a=await f.current;await a(d,{src_lang:m,tgt_lang:p,callback_function:n=>{A(a.tokenizer.decode(n[0].output_token_ids,{skip_special_tokens:!0}))}}),L("Done!"),n(!1)};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(s.sL,{gap:"$4",children:[(0,e.jsxs)(s.FA,{gap:"$4",children:[(0,e.jsx)(g,{type:"Source",defaultLanguage:"vie_Latn",onChange:j}),(0,e.jsx)(l.K,{value:d,size:"$6",onChange:b})]}),(0,e.jsxs)(s.FA,{gap:"$4",children:[(0,e.jsx)(g,{type:"Target",defaultLanguage:"eng_Latn",onChange:y}),(0,e.jsx)(l.K,{value:x,size:"$6",readOnly:!0})]})]}),(0,e.jsx)(_.zx,{disabled:a,onPress:S,children:"Translate"}),(0,e.jsx)(k,{text:h,percentage:u})]})};var x=t(6657),A=t(6855),f=t(2890),S=t(896),T=t(3742),v=t(391),z=t(6505),C=t(5737);let w={dark:(0,e.jsx)(f.J,{}),light:(0,e.jsx)(S.k,{}),system:(0,e.jsx)(A.u,{})};function M(){let[a,n]=(0,T.KO)(x.themeAtom);return(0,e.jsxs)(s.FA,{f:1,h:"100vh",jc:"center",ai:"center",p:"$4",gap:"$4",children:[(0,e.jsxs)(s.FA,{gap:"$4",bc:"$",jc:"center",children:[(0,e.jsx)(v.H1,{ta:"center",children:"Transformers.js + Tamagui"}),(0,e.jsx)(L.n,{ta:"center",children:"ML-powered multilingual translation directly in your browser!"})]}),(0,e.jsx)(z.Z,{}),(0,e.jsx)(y,{}),(0,e.jsx)(s.sL,{pos:"absolute",b:"$4",children:(0,e.jsxs)(L.n,{ta:"center",children:["Made with"," ",(0,e.jsx)(C.e,{href:"https://github.com/xenova/transformers.js",children:"\uD83E\uDD17 Transformers.js"})," + ",(0,e.jsx)(C.e,{href:"https://github.com/tamagui/tamagui",children:"Tamagui \uD83E\uDE84"}),". ",(0,e.jsx)(C.e,{href:"https://github.com/huuquyet/tranlator-tamagui",children:"Give it a ⭐️"})]})}),(0,e.jsx)(_.zx,{pos:"absolute",b:30,l:20,icon:w[a],onPress:n,circular:!0})]})}},6657:function(a,n,t){"use strict";t.d(n,{default:function(){return d},themeAtom:function(){return L}});var e=t(2281),i=t(9910),r=t(9010),s=t(1542),l=t(542),_=t(3742),o=t(6463),u=t(6608),c=t(7376);let h=(0,t(1564)._)(c.vc),L=function(a){let n=(0,i.cn)(a,(a,t,e)=>{let i="dark"===a(n)?"light":"light"===a(n)?"system":"dark";t(n,i)});return n}("system");function d(a){let{children:n,...t}=a,[i,c]=(0,r.U)(),d=(0,s.P)(),[b]=(0,_.KO)(L);return(0,o.useServerInsertedHTML)(()=>(0,e.jsx)("style",{dangerouslySetInnerHTML:{__html:h.getNewCSS({exclude:"design-system"})}})),(0,e.jsx)(l.G,{onChangeTheme:c,children:(0,e.jsx)(u.r,{config:h,defaultTheme:"system"===b?d.systemTheme:b,...t,children:n})})}}}]);
_next/static/chunks/842.3f8418770ac3440a.js ADDED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/app/_not-found/{page-71aafbb9ff8a5bfb.js β†’ page-c3d72fd6c9f4f96a.js} RENAMED
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[409],{5319:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return n(3586)}])},3586:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}}),n(5996);let i=n(7488);n(2170);let o={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},l={display:"inline-block"},r={display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},d={fontSize:14,fontWeight:400,lineHeight:"49px",margin:0};function s(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("title",{children:"404: This page could not be found."}),(0,i.jsx)("div",{style:o,children:(0,i.jsxs)("div",{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,i.jsx)("h1",{className:"next-error-h1",style:r,children:"404"}),(0,i.jsx)("div",{style:l,children:(0,i.jsx)("h2",{style:d,children:"This page could not be found."})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},function(e){e.O(0,[495,616,744],function(){return e(e.s=5319)}),_N_E=e.O()}]);
 
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[409],{7589:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return n(5457)}])},5457:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}}),n(1609);let i=n(2281);n(2265);let o={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},l={display:"inline-block"},r={display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},d={fontSize:14,fontWeight:400,lineHeight:"49px",margin:0};function s(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("title",{children:"404: This page could not be found."}),(0,i.jsx)("div",{style:o,children:(0,i.jsxs)("div",{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,i.jsx)("h1",{className:"next-error-h1",style:r,children:"404"}),(0,i.jsx)("div",{style:l,children:(0,i.jsx)("h2",{style:d,children:"This page could not be found."})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},function(e){e.O(0,[971,190,744],function(){return e(e.s=7589)}),_N_E=e.O()}]);
_next/static/chunks/app/layout-5f9b9579766ec96a.js DELETED
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{7960:function(e,t,n){Promise.resolve().then(n.bind(n,3982))},3982:function(e,t,n){"use strict";n.d(t,{Analytics:function(){return f}});var r=n(2170),a=n(956),o=()=>{window.va||(window.va=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];(window.vaq=window.vaq||[]).push(t)})};function c(){return"undefined"!=typeof window}function i(){return"production"}function u(){return"development"===((c()?window.vam:i())||"production")}function l(e){return(0,r.useEffect)(()=>{!function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debug:!0};if(!c())return;(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";if("auto"===e){window.vam=i();return}window.vam=e})(t.mode),o(),t.beforeSend&&(null==(e=window.va)||e.call(window,"beforeSend",t.beforeSend));let n=t.scriptSrc||(u()?"https://va.vercel-scripts.com/v1/script.debug.js":"/_vercel/insights/script.js");if(document.head.querySelector('script[src*="'.concat(n,'"]')))return;let r=document.createElement("script");r.src=n,r.defer=!0,r.dataset.sdkn="@vercel/analytics"+(t.framework?"/".concat(t.framework):""),r.dataset.sdkv="1.2.2",t.disableAutoTrack&&(r.dataset.disableAutoTrack="1"),t.endpoint&&(r.dataset.endpoint=t.endpoint),t.dsn&&(r.dataset.dsn=t.dsn),r.onerror=()=>{let e=u()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log("[Vercel Web Analytics] Failed to load script from ".concat(n,". ").concat(e))},u()&&!1===t.debug&&(r.dataset.debug="false"),document.head.appendChild(r)}({framework:e.framework||"react",...void 0!==e.route&&{disableAutoTrack:!0},...e})},[]),(0,r.useEffect)(()=>{e.route&&e.path&&function(e){var t;let{route:n,path:r}=e;null==(t=window.va)||t.call(window,"pageview",{route:n,path:r})}({route:e.route,path:e.path})},[e.route,e.path]),null}var s=()=>{let e=(0,a.useParams)(),t=(0,a.useSearchParams)(),n=(0,a.usePathname)(),r={...Object.fromEntries(t.entries()),...e||{}};return{route:e?function(e,t){if(!e||!t)return e;let n=e;try{for(let[e,r]of Object.entries(t)){let t=Array.isArray(r),a=t?r.join("/"):r,o=t?"...".concat(e):e,c=new RegExp("/".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"(?=[/?#]|$)"));c.test(n)&&(n=n.replace(c,"/[".concat(o,"]")))}return n}catch(t){return e}}(n,r):null,path:n}};function d(e){let{route:t,path:n}=s();return r.createElement(l,{path:n,route:t,...e,framework:"next"})}function f(e){return r.createElement(r.Suspense,{fallback:null},r.createElement(d,{...e}))}}},function(e){e.O(0,[495,616,744],function(){return e(e.s=7960)}),_N_E=e.O()}]);
 
 
_next/static/chunks/app/layout-b185c3776a59f483.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{9741:function(e,t,n){Promise.resolve().then(n.bind(n,2944)),Promise.resolve().then(n.bind(n,6657)),Promise.resolve().then(n.t.bind(n,2191,23))},6657:function(e,t,n){"use strict";n.d(t,{default:function(){return h},themeAtom:function(){return m}});var r=n(2281),o=n(9910),a=n(9010),c=n(1542),i=n(542),s=n(3742),u=n(6463),l=n(6608),d=n(7376);let f=(0,n(1564)._)(d.vc),m=function(e){let t=(0,o.cn)(e,(e,n,r)=>{let o="dark"===e(t)?"light":"light"===e(t)?"system":"dark";n(t,o)});return t}("system");function h(e){let{children:t,...n}=e,[o,d]=(0,a.U)(),h=(0,c.P)(),[w]=(0,s.KO)(m);return(0,u.useServerInsertedHTML)(()=>(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:f.getNewCSS({exclude:"design-system"})}})),(0,r.jsx)(i.G,{onChangeTheme:d,children:(0,r.jsx)(l.r,{config:f,defaultTheme:"system"===w?h.systemTheme:w,...n,children:t})})}},2191:function(){},2944:function(e,t,n){"use strict";n.d(t,{Analytics:function(){return f}});var r=n(2265),o=n(6463),a=()=>{window.va||(window.va=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];(window.vaq=window.vaq||[]).push(t)})};function c(){return"undefined"!=typeof window}function i(){return"production"}function s(){return"development"===((c()?window.vam:i())||"production")}function u(e){return(0,r.useEffect)(()=>{!function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debug:!0};if(!c())return;(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";if("auto"===e){window.vam=i();return}window.vam=e})(t.mode),a(),t.beforeSend&&(null==(e=window.va)||e.call(window,"beforeSend",t.beforeSend));let n=t.scriptSrc||(s()?"https://va.vercel-scripts.com/v1/script.debug.js":"/_vercel/insights/script.js");if(document.head.querySelector('script[src*="'.concat(n,'"]')))return;let r=document.createElement("script");r.src=n,r.defer=!0,r.dataset.sdkn="@vercel/analytics"+(t.framework?"/".concat(t.framework):""),r.dataset.sdkv="1.2.2",t.disableAutoTrack&&(r.dataset.disableAutoTrack="1"),t.endpoint&&(r.dataset.endpoint=t.endpoint),t.dsn&&(r.dataset.dsn=t.dsn),r.onerror=()=>{let e=s()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log("[Vercel Web Analytics] Failed to load script from ".concat(n,". ").concat(e))},s()&&!1===t.debug&&(r.dataset.debug="false"),document.head.appendChild(r)}({framework:e.framework||"react",...void 0!==e.route&&{disableAutoTrack:!0},...e})},[]),(0,r.useEffect)(()=>{e.route&&e.path&&function(e){var t;let{route:n,path:r}=e;null==(t=window.va)||t.call(window,"pageview",{route:n,path:r})}({route:e.route,path:e.path})},[e.route,e.path]),null}var l=()=>{let e=(0,o.useParams)(),t=(0,o.useSearchParams)(),n=(0,o.usePathname)(),r={...Object.fromEntries(t.entries()),...e||{}};return{route:e?function(e,t){if(!e||!t)return e;let n=e;try{for(let[e,r]of Object.entries(t)){let t=Array.isArray(r),o=t?r.join("/"):r,a=t?"...".concat(e):e,c=new RegExp("/".concat(o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"(?=[/?#]|$)"));c.test(n)&&(n=n.replace(c,"/[".concat(a,"]")))}return n}catch(t){return e}}(n,r):null,path:n}};function d(e){let{route:t,path:n}=l();return r.createElement(u,{path:n,route:t,...e,framework:"next"})}function f(e){return r.createElement(r.Suspense,{fallback:null},r.createElement(d,{...e}))}}},function(e){e.O(0,[33,107,971,190,744],function(){return e(e.s=9741)}),_N_E=e.O()}]);
_next/static/chunks/app/page-73a00cac215b7d81.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{9971:function(e,t,n){Promise.resolve().then(n.bind(n,8904))},551:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let l=n(1609);n(2281),n(2265);let r=l._(n(148));function u(e,t){var n;let l={loading:e=>{let{error:t,isLoading:n,pastDelay:l}=e;return null}};"function"==typeof e&&(l.loader=e);let u={...l,...t};return(0,r.default)({...u,modules:null==(n=u.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},912:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}});let l=n(5592);function r(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new l.BailoutToCSRError(t);return n}},148:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let l=n(2281),r=n(2265),u=n(912),o=n(1481);function i(e){return{default:e&&"default"in e?e.default:e}}let d={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},a=function(e){let t={...d,...e},n=(0,r.lazy)(()=>t.loader().then(i)),a=t.loading;function s(e){let i=a?(0,l.jsx)(a,{isLoading:!0,pastDelay:!0,error:null}):null,d=t.ssr?(0,l.jsxs)(l.Fragment,{children:["undefined"==typeof window?(0,l.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,l.jsx)(n,{...e})]}):(0,l.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,l.jsx)(n,{...e})});return(0,l.jsx)(r.Suspense,{fallback:i,children:d})}return s.displayName="LoadableComponent",s}},1481:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return r}});let l=n(2281);function r(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let{getExpectedRequestStore:r}=n(8512),u=r(),o=[];if(u.reactLoadableManifest&&t){let e=u.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));o.push(...t)}}return 0===o.length?null:(0,l.jsx)(l.Fragment,{children:o.map(e=>(0,l.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:u.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},8904:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return o}});var l=n(2281),r=n(551),u=n.n(r);function o(){let e=u()(()=>Promise.all([n.e(165),n.e(132),n.e(15),n.e(107),n.e(842),n.e(66)]).then(n.bind(n,1696)),{loadableGenerated:{webpack:()=>[1696]},ssr:!1});return(0,l.jsx)(e,{})}}},function(e){e.O(0,[971,190,744],function(){return e(e.s=9971)}),_N_E=e.O()}]);
_next/static/chunks/app/page-f4b111521485cce9.js DELETED
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8840:function(){},5484:function(){},879:function(){},2673:function(){},3266:function(){},8e3:function(){},8043:function(){},1616:function(a,n,t){Promise.resolve().then(t.bind(t,6344)),Promise.resolve().then(t.bind(t,5887)),Promise.resolve().then(t.t.bind(t,3053,23)),Promise.resolve().then(t.bind(t,8417))},8417:function(a,n,t){"use strict";t.r(n),t.d(n,{default:function(){return u}});var e=t(7488),i=t(5320),r=t(2170);let s={"Acehnese (Arabic script)":"ace_Arab","Acehnese (Latin script)":"ace_Latn",Afrikaans:"afr_Latn",Akan:"aka_Latn",Amharic:"amh_Ethi",Armenian:"hye_Armn",Assamese:"asm_Beng",Asturian:"ast_Latn",Awadhi:"awa_Deva","Ayacucho Quechua":"quy_Latn",Balinese:"ban_Latn",Bambara:"bam_Latn","Banjar (Arabic script)":"bjn_Arab","Banjar (Latin script)":"bjn_Latn",Bashkir:"bak_Cyrl",Basque:"eus_Latn",Belarusian:"bel_Cyrl",Bemba:"bem_Latn",Bengali:"ben_Beng",Bhojpuri:"bho_Deva",Bosnian:"bos_Latn",Buginese:"bug_Latn",Bulgarian:"bul_Cyrl",Burmese:"mya_Mymr",Catalan:"cat_Latn",Cebuano:"ceb_Latn","Central Atlas Tamazight":"tzm_Tfng","Central Aymara":"ayr_Latn","Central Kanuri (Arabic script)":"knc_Arab","Central Kanuri (Latin script)":"knc_Latn","Central Kurdish":"ckb_Arab",Chhattisgarhi:"hne_Deva","Chinese (Simplified)":"zho_Hans","Chinese (Traditional)":"zho_Hant",Chokwe:"cjk_Latn","Crimean Tatar":"crh_Latn",Croatian:"hrv_Latn",Czech:"ces_Latn",Danish:"dan_Latn",Dari:"prs_Arab",Dutch:"nld_Latn",Dyula:"dyu_Latn",Dzongkha:"dzo_Tibt","Eastern Panjabi":"pan_Guru","Eastern Yiddish":"ydd_Hebr","Egyptian Arabic":"arz_Arab",English:"eng_Latn",Esperanto:"epo_Latn",Estonian:"est_Latn",Ewe:"ewe_Latn",Faroese:"fao_Latn",Fijian:"fij_Latn",Finnish:"fin_Latn",Fon:"fon_Latn",French:"fra_Latn",Friulian:"fur_Latn",Galician:"glg_Latn",Ganda:"lug_Latn",Georgian:"kat_Geor",German:"deu_Latn",Greek:"ell_Grek",Guarani:"grn_Latn",Gujarati:"guj_Gujr","Haitian Creole":"hat_Latn","Halh Mongolian":"khk_Cyrl",Hausa:"hau_Latn",Hebrew:"heb_Hebr",Hindi:"hin_Deva",Hungarian:"hun_Latn",Icelandic:"isl_Latn",Igbo:"ibo_Latn",Ilocano:"ilo_Latn",Indonesian:"ind_Latn",Irish:"gle_Latn",Italian:"ita_Latn",Japanese:"jpn_Jpan",Javanese:"jav_Latn",Jingpho:"kac_Latn",KabiyΓ¨:"kbp_Latn",Kabuverdianu:"kea_Latn",Kabyle:"kab_Latn",Kamba:"kam_Latn",Kannada:"kan_Knda","Kashmiri (Arabic script)":"kas_Arab","Kashmiri (Devanagari script)":"kas_Deva",Kazakh:"kaz_Cyrl",Khmer:"khm_Khmr",Kikongo:"kon_Latn",Kikuyu:"kik_Latn",Kimbundu:"kmb_Latn",Kinyarwanda:"kin_Latn",Korean:"kor_Hang",Kyrgyz:"kir_Cyrl",Lao:"lao_Laoo",Latgalian:"ltg_Latn",Ligurian:"lij_Latn",Limburgish:"lim_Latn",Lingala:"lin_Latn",Lithuanian:"lit_Latn",Lombard:"lmo_Latn","Luba-Kasai":"lua_Latn",Luo:"luo_Latn",Luxembourgish:"ltz_Latn",Macedonian:"mkd_Cyrl",Magahi:"mag_Deva",Maithili:"mai_Deva",Malayalam:"mal_Mlym",Maltese:"mlt_Latn",Maori:"mri_Latn",Marathi:"mar_Deva","Meitei (Bengali script)":"mni_Beng","Mesopotamian Arabic":"acm_Arab","Minangkabau (Arabic script)":"min_Arab","Minangkabau (Latin script)":"min_Latn",Mizo:"lus_Latn","Modern Standard Arabic (Romanized)":"arb_Latn","Modern Standard Arabic":"arb_Arab","Moroccan Arabic":"ary_Arab",Mossi:"mos_Latn","Najdi Arabic":"ars_Arab",Nepali:"npi_Deva","Nigerian Fulfulde":"fuv_Latn","North Azerbaijani":"azj_Latn","North Levantine Arabic":"apc_Arab","Northern Kurdish":"kmr_Latn","Northern Sotho":"nso_Latn","Northern Uzbek":"uzn_Latn","Norwegian Bokm\xe5l":"nob_Latn","Norwegian Nynorsk":"nno_Latn",Nuer:"nus_Latn",Nyanja:"nya_Latn",Occitan:"oci_Latn",Odia:"ory_Orya",Pangasinan:"pag_Latn",Papiamento:"pap_Latn","Plateau Malagasy":"plt_Latn",Polish:"pol_Latn",Portuguese:"por_Latn",Romanian:"ron_Latn",Rundi:"run_Latn",Russian:"rus_Cyrl",Samoan:"smo_Latn",Sango:"sag_Latn",Sanskrit:"san_Deva",Santali:"sat_Olck",Sardinian:"srd_Latn","Scottish Gaelic":"gla_Latn",Serbian:"srp_Cyrl",Shan:"shn_Mymr",Shona:"sna_Latn",Sicilian:"scn_Latn",Silesian:"szl_Latn",Sindhi:"snd_Arab",Sinhala:"sin_Sinh",Slovak:"slk_Latn",Slovenian:"slv_Latn",Somali:"som_Latn","South Azerbaijani":"azb_Arab","South Levantine Arabic":"ajp_Arab","Southern Pashto":"pbt_Arab","Southern Sotho":"sot_Latn","Southwestern Dinka":"dik_Latn",Spanish:"spa_Latn","Standard Latvian":"lvs_Latn","Standard Malay":"zsm_Latn","Standard Tibetan":"bod_Tibt",Sundanese:"sun_Latn",Swahili:"swh_Latn",Swati:"ssw_Latn",Swedish:"swe_Latn",Tagalog:"tgl_Latn",Tajik:"tgk_Cyrl","Tamasheq (Latin script)":"taq_Latn","Tamasheq (Tifinagh script)":"taq_Tfng",Tamil:"tam_Taml",Tatar:"tat_Cyrl","Ta’izzi-Adeni Arabic":"acq_Arab",Telugu:"tel_Telu",Thai:"tha_Thai",Tigrinya:"tir_Ethi","Tok Pisin":"tpi_Latn","Tosk Albanian":"als_Latn",Tsonga:"tso_Latn",Tswana:"tsn_Latn",Tumbuka:"tum_Latn","Tunisian Arabic":"aeb_Arab",Turkish:"tur_Latn",Turkmen:"tuk_Latn",Twi:"twi_Latn",Ukrainian:"ukr_Cyrl",Umbundu:"umb_Latn",Urdu:"urd_Arab",Uyghur:"uig_Arab",Venetian:"vec_Latn",Vietnamese:"vie_Latn",Waray:"war_Latn",Welsh:"cym_Latn","West Central Oromo":"gaz_Latn","Western Persian":"pes_Arab",Wolof:"wol_Latn",Xhosa:"xho_Latn",Yoruba:"yor_Latn","Yue Chinese":"yue_Hant",Zulu:"zul_Latn"},_=a=>{let{type:n,onChange:t,defaultLanguage:i}=a;return(0,e.jsxs)("div",{className:"language-selector",children:[(0,e.jsxs)("label",{children:[n,": "]}),(0,e.jsx)("select",{onChange:t,defaultValue:i,children:Object.entries(s).map(a=>{let[n,t]=a;return(0,e.jsx)("option",{value:t,children:n},n)})})]})},l=a=>{let{text:n,percentage:t}=a;return t=null!=t?t:0,(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{children:n}),(0,e.jsx)("div",{className:"progress-container",children:(0,e.jsx)("div",{className:"progress-bar",style:{width:"".concat(100*t,"%"),height:"1em"}})})]})},o=()=>{let[a,n]=(0,r.useState)(!0),[t,s]=(0,r.useState)({}),[o,u]=(0,r.useState)(0),[L,c]=(0,r.useState)("Loading model (927MB)..."),[h,b]=(0,r.useState)("T\xf4i y\xeau Việt Nam qu\xea hΖ°Ζ‘ng t\xf4i."),[d,g]=(0,r.useState)("vie_Latn"),[m,k]=(0,r.useState)("eng_Latn"),[p,y]=(0,r.useState)(""),A=(0,r.useRef)(null);(0,r.useEffect)(()=>{var a;null!==(a=A.current)&&void 0!==a||(A.current=(0,i.EUT)("translation","Xenova/nllb-200-distilled-600M",{quantized:!0,progress_callback:a=>{"progress"===a.status&&s(n=>({...n,[a.file]:a}))}}))},[]),(0,r.useEffect)(()=>{n(!0),Object.values(t);let a=0,e=0;for(let n of Object.values(t))a+=n.loaded,e+=n.total;let i=a/e;u(i),c(1===i?"Ready!":"Loading model (".concat((100*i).toFixed(),"% of 927MB)...")),n(!1)},[t]);let j=async()=>{n(!0),c("Translating..."),y("");let a=await A.current;await a(h,{src_lang:d,tgt_lang:m,callback_function:n=>{y(a.tokenizer.decode(n[0].output_token_ids,{skip_special_tokens:!0}))}}),c("Done!"),n(!1)};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"container",children:[(0,e.jsxs)("div",{className:"language-container",children:[(0,e.jsx)(_,{type:"Source",defaultLanguage:"vie_Latn",onChange:a=>g(a.target.value)}),(0,e.jsx)(_,{type:"Target",defaultLanguage:"eng_Latn",onChange:a=>k(a.target.value)})]}),(0,e.jsxs)("div",{className:"textbox-container",children:[(0,e.jsx)("textarea",{value:h,rows:3,onChange:a=>b(a.target.value)}),(0,e.jsx)("textarea",{value:p,rows:3,readOnly:!0})]})]}),(0,e.jsx)("button",{type:"button",disabled:a,onClick:j,children:"Translate"}),(0,e.jsx)("div",{className:"progress-bars-container",children:(0,e.jsx)(l,{text:L,percentage:o})})]})};function u(){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("h1",{children:"Transformers.js + Next.js"}),(0,e.jsx)("h3",{children:"ML-powered multilingual translation in React!"}),(0,e.jsx)(o,{})]})}},3053:function(){}},function(a){a.O(0,[82,138,309,172,528,495,616,744],function(){return a(a.s=1616)}),_N_E=a.O()}]);
 
 
_next/static/chunks/{c9e07ca6-4ee53eda494071d7.js β†’ b2db8554.2f90d90ec938bc93.js} RENAMED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/{d0d14972-f06041a19692f927.js β†’ fd9d1056-8fba21ecb5fa45b6.js} RENAMED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/{framework-2a0f2580bcbf19fb.js β†’ framework-aec844d2ccbe7592.js} RENAMED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/main-7111bfe9b3c4c0d0.js DELETED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/main-app-8591d221f05263ff.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{7141:function(e,n,t){Promise.resolve().then(t.t.bind(t,5751,23)),Promise.resolve().then(t.t.bind(t,6513,23)),Promise.resolve().then(t.t.bind(t,6130,23)),Promise.resolve().then(t.t.bind(t,9275,23)),Promise.resolve().then(t.t.bind(t,5324,23)),Promise.resolve().then(t.t.bind(t,1343,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,190],function(){return n(7804),n(1028),n(7141)}),_N_E=e.O()}]);
_next/static/chunks/main-app-aee585b6ec97b206.js DELETED
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{366:function(e,n,t){Promise.resolve().then(t.t.bind(t,2321,23)),Promise.resolve().then(t.t.bind(t,9339,23)),Promise.resolve().then(t.t.bind(t,2314,23)),Promise.resolve().then(t.t.bind(t,6113,23)),Promise.resolve().then(t.t.bind(t,2669,23)),Promise.resolve().then(t.t.bind(t,4245,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[495,616],function(){return n(7580),n(6262),n(366)}),_N_E=e.O()}]);
 
 
_next/static/chunks/main-fb740fb39bc15572.js ADDED
The diff for this file is too large to render. See raw diff
 
_next/static/chunks/pages/_app-6a626577ffa902a4.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{1597:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return u(2239)}])}},function(n){var _=function(_){return n(n.s=_)};n.O(0,[774,179],function(){return _(1597),_(6036)}),_N_E=n.O()}]);
_next/static/chunks/pages/_app-da5442636db34eba.js DELETED
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{1448:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return u(5684)}])}},function(n){var _=function(_){return n(n.s=_)};n.O(0,[774,179],function(){return _(1448),_(2100)}),_N_E=n.O()}]);
 
 
_next/static/chunks/pages/_error-10ab295e4702c5ac.js DELETED
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[820],{2166:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return u(1874)}])}},function(n){n.O(0,[888,774,179],function(){return n(n.s=2166)}),_N_E=n.O()}]);
 
 
_next/static/chunks/pages/_error-1be831200e60c5c0.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[820],{1981:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return u(3387)}])}},function(n){n.O(0,[888,774,179],function(){return n(n.s=1981)}),_N_E=n.O()}]);
_next/static/chunks/webpack-76c22cfb480fa812.js DELETED
@@ -1 +0,0 @@
1
- !function(){"use strict";var e,t,r,n,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var r=l[e]={exports:{}},n=!0;try{a[e](r,r.exports,s),n=!1}finally{n&&delete l[e]}return r.exports}s.m=a,e=[],s.O=function(t,r,n,o){if(r){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,n,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var r=e[u][0],n=e[u][1],o=e[u][2],c=!0,f=0;f<r.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](r[f])})?r.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=n();void 0!==a&&(t=a)}}return t},r=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,n){if(1&n&&(e=this(e)),8&n||"object"==typeof e&&e&&(4&n&&e.__esModule||16&n&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,r({}),r([]),r(r)];for(var i=2&n&&e;"object"==typeof i&&!~t.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,r){return s.f[r](e,t),t},[]))},s.u=function(e){},s.miniCssF=function(e){},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n={},o="_N_E:",s.l=function(e,t,r,u){if(n[e]){n[e].push(t);return}if(void 0!==r)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+r){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+r),i.src=s.tu(e)),n[e]=[t];var d=function(t,r){i.onerror=i.onload=null,clearTimeout(p);var o=n[e];if(delete n[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(r)}),t)return t(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},s.tu=function(e){return s.tt().createScriptURL(e)},s.p="/_next/",i={272:0,82:0},s.f.j=function(e,t){var r=s.o(i,e)?i[e]:void 0;if(0!==r){if(r)t.push(r[2]);else if(/^(27|8)2$/.test(e))i[e]=0;else{var n=new Promise(function(t,n){r=i[e]=[t,n]});t.push(r[2]=n);var o=s.p+s.u(e),u=Error();s.l(o,function(t){if(s.o(i,e)&&(0!==(r=i[e])&&(i[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",u.name="ChunkLoadError",u.type=n,u.request=o,r[1](u)}},"chunk-"+e,e)}}},s.O.j=function(e){return 0===i[e]},c=function(e,t){var r,n,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(r in u)s.o(u,r)&&(s.m[r]=u[r]);if(c)var a=c(s)}for(e&&e(t);f<o.length;f++)n=o[f],s.o(i,n)&&i[n]&&i[n][0](),i[n]=0;return s.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f))}();
 
 
_next/static/chunks/webpack-cb993d10a9392443.js ADDED
@@ -0,0 +1 @@
 
 
1
+ !function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},d={};function l(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}},r=!0;try{a[e](n,n.exports,l),r=!1}finally{r&&delete d[e]}return n.exports}l.m=a,e=[],l.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(l.O).every(function(e){return l.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},l.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);l.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},l.d(o,u),o},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=function(e){return Promise.all(Object.keys(l.f).reduce(function(t,n){return l.f[n](e,t),t},[]))},l.u=function(e){return 107===e?"static/chunks/107-24dc2a03cc950c79.js":"static/chunks/"+(({15:"b2db8554",132:"6139e184",165:"590caa2a"})[e]||e)+"."+({15:"2f90d90ec938bc93",66:"deca4787bfb39346",132:"ec466d5482164223",165:"699039c37022246b",842:"3f8418770ac3440a"})[e]+".js"},l.miniCssF=function(e){},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",l.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var d=f[a];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==o+n){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,l.nc&&i.setAttribute("nonce",l.nc),i.setAttribute("data-webpack",o+n),i.src=l.tu(e)),r[e]=[t];var s=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=s.bind(null,i.onerror),i.onload=s.bind(null,i.onload),c&&document.head.appendChild(i)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},l.tu=function(e){return l.tt().createScriptURL(e)},l.p="/_next/",i={272:0,33:0},l.f.j=function(e,t){var n=l.o(i,e)?i[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(/^(272|33)$/.test(e))i[e]=0;else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=l.p+l.u(e),u=Error();l.l(o,function(t){if(l.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}}},l.O.j=function(e){return 0===i[e]},c=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)l.o(u,n)&&(l.m[n]=u[n]);if(c)var a=c(l)}for(e&&e(t);f<o.length;f++)r=o[f],l.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return l.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f)),l.nc=void 0}();
_next/static/css/2f64c11402f89eba.css DELETED
@@ -1,3 +0,0 @@
1
- /*
2
- ! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com
3
- */*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color:#213547;background-color:#fff;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh;flex-direction:column;justify-content:center}h1{font-size:3.2em;line-height:1}h1,h2{margin:8px}.container{margin:25px;display:flex;flex-direction:column;gap:10px}.language-container{display:flex;gap:20px}.language-selector>select{width:150px}.textbox-container{display:flex;justify-content:center;gap:20px;width:800px}.language-selector,.textbox-container>textarea{width:50%}.selector-container{display:flex;gap:20px}select{padding:.3em;cursor:pointer}textarea{padding:.6em}.progress-bars-container{padding:8px;height:140px;text-align:center;min-width:340px}.progress-container{position:relative;font-size:14px;color:#fff;background-color:#e9ecef;border:1px solid;border-radius:8px;overflow:hidden}.progress-bar{padding:0 4px;z-index:0;top:0;width:1%;height:100%;overflow:hidden;background-color:#007bff;white-space:nowrap}.progress-text{z-index:2}button{padding:.6em 1.2em;cursor:pointer;font-weight:500}button[disabled]{cursor:not-allowed}button,select,textarea{border-radius:8px;border:1px solid transparent;font-size:1em;font-family:inherit;background-color:#f9f9f9;transition:border-color .25s}button:not([disabled]):hover,select:hover,textarea:hover{border-color:#646cff}button:focus,button:focus-visible,select:focus,select:focus-visible,textarea:focus,textarea:focus-visible{outline:4px auto -webkit-focus-ring-color}
 
 
 
 
_next/static/css/c07dfed9e589ce2b.css ADDED
The diff for this file is too large to render. See raw diff
 
images/adaptive-icon.png ADDED
{icons β†’ images}/android-icon-192x192.png RENAMED
File without changes
{icons β†’ images}/android-icon-512x512.png RENAMED
File without changes
{icons β†’ images}/apple-icon-16x16.png RENAMED
File without changes
{icons β†’ images}/apple-icon-32x32.png RENAMED
File without changes
icons/apple-touch-icon.png β†’ images/apple-icon.png RENAMED
File without changes
images/favicon.png ADDED
images/icon.png ADDED
{icons β†’ images}/safari-pinned-tab.svg RENAMED
File without changes
{icons β†’ images}/share.png RENAMED
File without changes
images/splash.png ADDED
index.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/2f64c11402f89eba.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-76c22cfb480fa812.js"/><script src="/_next/static/chunks/d0d14972-f06041a19692f927.js" async=""></script><script src="/_next/static/chunks/616-4a3447e4a89711ca.js" async=""></script><script src="/_next/static/chunks/main-app-aee585b6ec97b206.js" async=""></script><script src="/_next/static/chunks/5f09d46c-d4955f71949979a4.js" async=""></script><script src="/_next/static/chunks/40bfc07d-7d2b96f8f95c7906.js" async=""></script><script src="/_next/static/chunks/c9e07ca6-4ee53eda494071d7.js" async=""></script><script src="/_next/static/chunks/528-278ce8f7ba7eac7e.js" async=""></script><script src="/_next/static/chunks/app/page-f4b111521485cce9.js" async=""></script><script src="/_next/static/chunks/app/layout-5f9b9579766ec96a.js" async=""></script><title>Translator demo app built with Transformers.js + Tamagui + Next.js</title><meta name="description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta name="application-name" content="Translator Demo"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><meta name="keywords" content="Translator,Transformers.js,Next.js,Tamagui"/><meta name="format-detection" content="telephone=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><meta property="og:title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta property="og:description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta property="og:url" content="https://hf.co/spaces/huuquyet/translator-tamagui/"/><meta property="og:site_name" content="Translator Demo"/><meta property="og:image" content="https://${process.env.vercel_url}/icon/share.png"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@HuuQuyetNg"/><meta name="twitter:title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta name="twitter:description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta name="twitter:image" content="https://${process.env.vercel_url}/icon/share.png"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--><script src="/_next/static/chunks/webpack-76c22cfb480fa812.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/2f64c11402f89eba.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2321,[],\"\"]\n4:\"$Sreact.suspense\"\n5:I[6344,[\"138\",\"static/chunks/5f09d46c-d4955f71949979a4.js\",\"309\",\"static/chunks/40bfc07d-7d2b96f8f95c7906.js\",\"172\",\"static/chunks/c9e07ca6-4ee53eda494071d7.js\",\"528\",\"static/chunks/528-278ce8f7ba7eac7e.js\",\"931\",\"static/chunks/app/page-f4b111521485cce9.js\"],\"BailoutToCSR\"]\n7:I[6113,[],\"\"]\n8:I[4245,[],\"\"]\n9:I[3982,[\"185\",\"static/chunks/app/layout-5f9b9579766ec96a.js\"],\"Analytics\"]\nb:I[2314,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[null,[\"$\",\"$L2\",null,{\"buildId\":\"UPicdb8faPBPzSbOulfRb\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/\",\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$4\",null,{\"fallback\":null,\"children\":[\"$\",\"$L5\",null,{\"reason\":\"next/dynamic\",\"children\":\"$L6\"}]}]],null],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/2f64c11402f89eba.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]}],[\"$\",\"$L9\",null,{}]]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[8417,[\"138\",\"static/chunks/5f09d46c-d4955f71949979a4.js\",\"309\",\"static/chunks/40bfc07d-7d2b96f8f95c7906.js\",\"172\",\"static/chunks/c9e07ca6-4ee53eda494071d7.js\",\"528\",\"static/chunks/528-278ce8f7ba7eac7e.js\",\"931\",\"static/chunks/app/page-f4b111521485cce9.js\"],\"default\"]\n6:[\"$\",\"$Ld\",null,{}]\na:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"4\",{\"name\":\"application-name\",\"content\":\"Translator Demo\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"Translator,Transformers.js,Next.js,Tamagui\"}],[\"$\",\"meta\",\"7\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"8\",{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"9\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"10\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:url\",\"content\":\"https://hf.co/spaces/huuquyet/translator-tamagui/\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:site_name\",\"content\":\"Translator Demo\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:site\",\"content\":\"@HuuQuyetNg\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:title\",\"content\":\"Translator demo app bui"])</script><script>self.__next_f.push([1,"lt with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}]]\n3:null\n"])</script></body></html>
 
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/c07dfed9e589ce2b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-cb993d10a9392443.js"/><script src="/_next/static/chunks/fd9d1056-8fba21ecb5fa45b6.js" async=""></script><script src="/_next/static/chunks/190-b97855758bb23886.js" async=""></script><script src="/_next/static/chunks/main-app-8591d221f05263ff.js" async=""></script><script src="/_next/static/chunks/app/page-73a00cac215b7d81.js" async=""></script><script src="/_next/static/chunks/107-24dc2a03cc950c79.js" async=""></script><script src="/_next/static/chunks/app/layout-b185c3776a59f483.js" async=""></script><title>Translator demo app built with Transformers.js + Tamagui + Next.js</title><meta name="description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta name="application-name" content="Translator Demo"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><meta name="keywords" content="Translator,Transformers.js,Next.js,Tamagui"/><meta name="format-detection" content="telephone=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><meta property="og:title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta property="og:description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta property="og:url" content="https://hf.co/spaces/huuquyet/translator-tamagui/"/><meta property="og:site_name" content="Translator Demo"/><meta property="og:image" content="https://${process.env.vercel_url}/icon/share.png"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@HuuQuyetNg"/><meta name="twitter:title" content="Translator demo app built with Transformers.js + Tamagui + Next.js"/><meta name="twitter:description" content="Translator demo app built with Transformer.js + Tamagui + Next.js"/><meta name="twitter:image" content="https://${process.env.vercel_url}/icon/share.png"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script><style></style></head><body><span class="t_light is_inversed _dsp_contents"><span class=" t_light _dsp_contents is_Theme" style="color:var(--color)"><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--></span></span><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--><script src="/_next/static/chunks/webpack-cb993d10a9392443.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/c07dfed9e589ce2b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[5751,[],\"\"]\n4:I[6513,[],\"ClientPageRoot\"]\n5:I[8904,[\"931\",\"static/chunks/app/page-73a00cac215b7d81.js\"],\"default\"]\n6:I[6657,[\"107\",\"static/chunks/107-24dc2a03cc950c79.js\",\"185\",\"static/chunks/app/layout-b185c3776a59f483.js\"],\"default\"]\n7:I[9275,[],\"\"]\n8:I[1343,[],\"\"]\n9:I[2944,[\"107\",\"static/chunks/107-24dc2a03cc950c79.js\",\"185\",\"static/chunks/app/layout-b185c3776a59f483.js\"],\"Analytics\"]\nb:I[6130,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c07dfed9e589ce2b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L2\",null,{\"buildId\":\"2yIdB6J6TFtzbtR43oIj6\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/\",\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$5\"}]],null],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L8\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}]}],[\"$\",\"$L9\",null,{}]]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"4\",{\"name\":\"application-name\",\"content\":\"Translator Demo\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"Translator,Transformers.js,Next.js,Tamagui\"}],[\"$\",\"meta\",\"7\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"8\",{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"9\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"10\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:url\",\"content\":\"https://hf.co/spaces/huuquyet/translator-tamagui/\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:site_name\",\"content\":\"Translator Demo\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:site\",\"content\":\"@HuuQuyetNg\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:title\",\"content\":\"Translator demo app built with Transformers.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:description\",\"content\":\"Translator demo app built with Transformer.js + Tamagui + Next.js\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image\",\"content\":\"https://${process.env.vercel_url}/icon/share.png\"}]]\n3:null\n"])</script></body></html><style></style>
index.txt CHANGED
@@ -1,10 +1,9 @@
1
- 2:"$Sreact.suspense"
2
- 3:I[6344,["138","static/chunks/5f09d46c-d4955f71949979a4.js","309","static/chunks/40bfc07d-7d2b96f8f95c7906.js","172","static/chunks/c9e07ca6-4ee53eda494071d7.js","528","static/chunks/528-278ce8f7ba7eac7e.js","931","static/chunks/app/page-f4b111521485cce9.js"],"BailoutToCSR"]
3
- 5:I[6113,[],""]
4
- 6:I[4245,[],""]
5
- 7:I[3982,["185","static/chunks/app/layout-5f9b9579766ec96a.js"],"Analytics"]
6
- 0:["UPicdb8faPBPzSbOulfRb",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$2",null,{"fallback":null,"children":["$","$L3",null,{"reason":"next/dynamic","children":"$L4"}]}]],null],null]},[["$","html",null,{"lang":"en","children":[["$","head",null,{}],["$","body",null,{"children":[["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2f64c11402f89eba.css","precedence":"next","crossOrigin":"$undefined"}]]}],["$","$L7",null,{}]]}]]}],null],null],[null,"$L8"]]]]
7
- 9:I[8417,["138","static/chunks/5f09d46c-d4955f71949979a4.js","309","static/chunks/40bfc07d-7d2b96f8f95c7906.js","172","static/chunks/c9e07ca6-4ee53eda494071d7.js","528","static/chunks/528-278ce8f7ba7eac7e.js","931","static/chunks/app/page-f4b111521485cce9.js"],"default"]
8
- 4:["$","$L9",null,{}]
9
  8:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Translator demo app built with Transformers.js + Tamagui + Next.js"}],["$","meta","3",{"name":"description","content":"Translator demo app built with Transformer.js + Tamagui + Next.js"}],["$","meta","4",{"name":"application-name","content":"Translator Demo"}],["$","link","5",{"rel":"manifest","href":"/manifest.json","crossOrigin":"use-credentials"}],["$","meta","6",{"name":"keywords","content":"Translator,Transformers.js,Next.js,Tamagui"}],["$","meta","7",{"name":"format-detection","content":"telephone=no"}],["$","meta","8",{"name":"apple-mobile-web-app-capable","content":"yes"}],["$","meta","9",{"name":"apple-mobile-web-app-title","content":"Translator demo app built with Transformers.js + Tamagui + Next.js"}],["$","meta","10",{"name":"apple-mobile-web-app-status-bar-style","content":"default"}],["$","meta","11",{"property":"og:title","content":"Translator demo app built with Transformers.js + Tamagui + Next.js"}],["$","meta","12",{"property":"og:description","content":"Translator demo app built with Transformer.js + Tamagui + Next.js"}],["$","meta","13",{"property":"og:url","content":"https://hf.co/spaces/huuquyet/translator-tamagui/"}],["$","meta","14",{"property":"og:site_name","content":"Translator Demo"}],["$","meta","15",{"property":"og:image","content":"https://${process.env.vercel_url}/icon/share.png"}],["$","meta","16",{"property":"og:type","content":"website"}],["$","meta","17",{"name":"twitter:card","content":"summary"}],["$","meta","18",{"name":"twitter:site","content":"@HuuQuyetNg"}],["$","meta","19",{"name":"twitter:title","content":"Translator demo app built with Transformers.js + Tamagui + Next.js"}],["$","meta","20",{"name":"twitter:description","content":"Translator demo app built with Transformer.js + Tamagui + Next.js"}],["$","meta","21",{"name":"twitter:image","content":"https://${process.env.vercel_url}/icon/share.png"}]]
10
  1:null
 
1
+ 2:I[6513,[],"ClientPageRoot"]
2
+ 3:I[8904,["931","static/chunks/app/page-73a00cac215b7d81.js"],"default"]
3
+ 4:I[6657,["107","static/chunks/107-24dc2a03cc950c79.js","185","static/chunks/app/layout-b185c3776a59f483.js"],"default"]
4
+ 5:I[9275,[],""]
5
+ 6:I[1343,[],""]
6
+ 7:I[2944,["107","static/chunks/107-24dc2a03cc950c79.js","185","static/chunks/app/layout-b185c3776a59f483.js"],"Analytics"]
7
+ 0:["2yIdB6J6TFtzbtR43oIj6",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}]],null],null]},[["$","html",null,{"lang":"en","children":[["$","head",null,{}],["$","body",null,{"children":[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","$L7",null,{}]]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/c07dfed9e589ce2b.css","precedence":"next","crossOrigin":"$undefined"}]],"$L8"]]]]
 
8
  8:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Translator demo app built with Transformers.js + Tamagui + Next.js"}],["$","meta","3",{"name":"description","content":"Translator demo app built with Transformer.js + Tamagui + Next.js"}],["$","meta","4",{"name":"application-name","content":"Translator Demo"}],["$","link","5",{"rel":"manifest","href":"/manifest.json","crossOrigin":"use-credentials"}],["$","meta","6",{"name":"keywords","content":"Translator,Transformers.js,Next.js,Tamagui"}],["$","meta","7",{"name":"format-detection","content":"telephone=no"}],["$","meta","8",{"name":"apple-mobile-web-app-capable","content":"yes"}],["$","meta","9",{"name":"apple-mobile-web-app-title","content":"Translator demo app built with Transformers.js + Tamagui + Next.js"}],["$","meta","10",{"name":"apple-mobile-web-app-status-bar-style","content":"default"}],["$","meta","11",{"property":"og:title","content":"Translator demo app built with Transformers.js + Tamagui + Next.js"}],["$","meta","12",{"property":"og:description","content":"Translator demo app built with Transformer.js + Tamagui + Next.js"}],["$","meta","13",{"property":"og:url","content":"https://hf.co/spaces/huuquyet/translator-tamagui/"}],["$","meta","14",{"property":"og:site_name","content":"Translator Demo"}],["$","meta","15",{"property":"og:image","content":"https://${process.env.vercel_url}/icon/share.png"}],["$","meta","16",{"property":"og:type","content":"website"}],["$","meta","17",{"name":"twitter:card","content":"summary"}],["$","meta","18",{"name":"twitter:site","content":"@HuuQuyetNg"}],["$","meta","19",{"name":"twitter:title","content":"Translator demo app built with Transformers.js + Tamagui + Next.js"}],["$","meta","20",{"name":"twitter:description","content":"Translator demo app built with Transformer.js + Tamagui + Next.js"}],["$","meta","21",{"name":"twitter:image","content":"https://${process.env.vercel_url}/icon/share.png"}]]
9
  1:null
manifest.json CHANGED
@@ -3,19 +3,19 @@
3
  "short_name": "translator-tamagui",
4
  "icons": [
5
  {
6
- "src": "/icons/apple-touch-icon.png",
7
  "sizes": "64x64 32x32 24x24 16x16",
8
  "type": "image/x-icon",
9
  "purpose": "any maskable"
10
  },
11
  {
12
- "src": "/icons/android-icon-192x192.png",
13
  "sizes": "192x192",
14
  "type": "image/png",
15
  "purpose": "any maskable"
16
  },
17
  {
18
- "src": "/icons/android-icon-512x512.png",
19
  "sizes": "512x512",
20
  "type": "image/png",
21
  "purpose": "any maskable"
 
3
  "short_name": "translator-tamagui",
4
  "icons": [
5
  {
6
+ "src": "/images/apple-icon.png",
7
  "sizes": "64x64 32x32 24x24 16x16",
8
  "type": "image/x-icon",
9
  "purpose": "any maskable"
10
  },
11
  {
12
+ "src": "/images/android-icon-192x192.png",
13
  "sizes": "192x192",
14
  "type": "image/png",
15
  "purpose": "any maskable"
16
  },
17
  {
18
+ "src": "/images/android-icon-512x512.png",
19
  "sizes": "512x512",
20
  "type": "image/png",
21
  "purpose": "any maskable"
sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let e,s={};const a=(a,n)=>(a=new URL(a+".js",n).href,s[a]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=a,e.onload=s,document.head.appendChild(e)}else e=a,importScripts(a),s()})).then((()=>{let e=s[a];if(!e)throw new Error(`Module ${a} didn’t register its module`);return e})));self.define=(n,i)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(s[c])return;let t={};const r=e=>a(e,c),o={module:{uri:c},exports:t,require:r};s[c]=Promise.all(n.map((e=>o[e]||r(e)))).then((e=>(i(...e),t)))}}define(["./workbox-cb82a8da"],(function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/static/UPicdb8faPBPzSbOulfRb/_buildManifest.js",revision:"b5588a2f92a6551c266b2b1b75fa765f"},{url:"/_next/static/UPicdb8faPBPzSbOulfRb/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/chunks/40bfc07d-7d2b96f8f95c7906.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/528-278ce8f7ba7eac7e.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/5f09d46c-d4955f71949979a4.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/616-4a3447e4a89711ca.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/app/_not-found/page-71aafbb9ff8a5bfb.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/app/layout-5f9b9579766ec96a.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/app/page-f4b111521485cce9.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/c9e07ca6-4ee53eda494071d7.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/d0d14972-f06041a19692f927.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/framework-2a0f2580bcbf19fb.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/main-7111bfe9b3c4c0d0.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/main-app-aee585b6ec97b206.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/pages/_app-da5442636db34eba.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/pages/_error-10ab295e4702c5ac.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js",revision:"79330112775102f91e1010318bae2bd3"},{url:"/_next/static/chunks/webpack-76c22cfb480fa812.js",revision:"UPicdb8faPBPzSbOulfRb"},{url:"/_next/static/css/2f64c11402f89eba.css",revision:"2f64c11402f89eba"},{url:"/favicon.ico",revision:"4106c96e0a55d35b1b13fa4281a907b7"},{url:"/icons/android-icon-192x192.png",revision:"9f29f1d7c8f6da2d2e64bce1d3136d3f"},{url:"/icons/android-icon-512x512.png",revision:"9f29f1d7c8f6da2d2e64bce1d3136d3f"},{url:"/icons/apple-icon-16x16.png",revision:"5998cde017dee1b68827ac575ce6a300"},{url:"/icons/apple-icon-32x32.png",revision:"2a82680a8c270c3ad4b8341f5ef897f8"},{url:"/icons/apple-touch-icon.png",revision:"538a91302401ac461adfe1b509181921"},{url:"/icons/safari-pinned-tab.svg",revision:"5876746bbc008fdab40fd1abf568ca6b"},{url:"/icons/share.png",revision:"f04a8d2b41543ef4669c07e6d04e2d94"},{url:"/manifest.json",revision:"4a29967a121410a5d56683f4a762f67d"},{url:"/vercel.svg",revision:"26bf2d0adaf1028a4d4c6ee77005e819"}],{ignoreURLParametersMatching:[/^utm_/,/^fbclid$/]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({response:e})=>e&&"opaqueredirect"===e.type?new Response(e.body,{status:200,statusText:"OK",headers:e.headers}):e}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:2592e3})]}),"GET"),e.registerRoute(/\/_next\/static.+\.js$/i,new e.CacheFirst({cacheName:"next-static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4|webm)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:48,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({sameOrigin:e,url:{pathname:s}})=>!(!e||s.startsWith("/api/auth/callback")||!s.startsWith("/api/"))),new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({request:e,url:{pathname:s},sameOrigin:a})=>"1"===e.headers.get("RSC")&&"1"===e.headers.get("Next-Router-Prefetch")&&a&&!s.startsWith("/api/")),new e.NetworkFirst({cacheName:"pages-rsc-prefetch",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({request:e,url:{pathname:s},sameOrigin:a})=>"1"===e.headers.get("RSC")&&a&&!s.startsWith("/api/")),new e.NetworkFirst({cacheName:"pages-rsc",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:{pathname:e},sameOrigin:s})=>s&&!e.startsWith("/api/")),new e.NetworkFirst({cacheName:"pages",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({sameOrigin:e})=>!e),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")}));
 
1
+ if(!self.define){let e,s={};const a=(a,n)=>(a=new URL(a+".js",n).href,s[a]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=a,e.onload=s,document.head.appendChild(e)}else e=a,importScripts(a),s()})).then((()=>{let e=s[a];if(!e)throw new Error(`Module ${a} didn’t register its module`);return e})));self.define=(n,i)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let c={};const r=e=>a(e,t),o={module:{uri:t},exports:c,require:r};s[t]=Promise.all(n.map((e=>o[e]||r(e)))).then((e=>(i(...e),c)))}}define(["./workbox-c06b064f"],(function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/static/2yIdB6J6TFtzbtR43oIj6/_buildManifest.js",revision:"2ec694eb52ae4f523f265a46bae4d768"},{url:"/_next/static/2yIdB6J6TFtzbtR43oIj6/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/chunks/107-24dc2a03cc950c79.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/190-b97855758bb23886.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/590caa2a.699039c37022246b.js",revision:"699039c37022246b"},{url:"/_next/static/chunks/6139e184.ec466d5482164223.js",revision:"ec466d5482164223"},{url:"/_next/static/chunks/66.deca4787bfb39346.js",revision:"deca4787bfb39346"},{url:"/_next/static/chunks/842.3f8418770ac3440a.js",revision:"3f8418770ac3440a"},{url:"/_next/static/chunks/app/_not-found/page-c3d72fd6c9f4f96a.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/app/layout-b185c3776a59f483.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/app/page-73a00cac215b7d81.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/b2db8554.2f90d90ec938bc93.js",revision:"2f90d90ec938bc93"},{url:"/_next/static/chunks/fd9d1056-8fba21ecb5fa45b6.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/framework-aec844d2ccbe7592.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/main-app-8591d221f05263ff.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/main-fb740fb39bc15572.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/pages/_app-6a626577ffa902a4.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/pages/_error-1be831200e60c5c0.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js",revision:"79330112775102f91e1010318bae2bd3"},{url:"/_next/static/chunks/webpack-cb993d10a9392443.js",revision:"2yIdB6J6TFtzbtR43oIj6"},{url:"/_next/static/css/c07dfed9e589ce2b.css",revision:"c07dfed9e589ce2b"},{url:"/favicon.ico",revision:"4106c96e0a55d35b1b13fa4281a907b7"},{url:"/images/adaptive-icon.png",revision:"97dae5a0e62ad8551d8a31897b425e63"},{url:"/images/android-icon-192x192.png",revision:"9f29f1d7c8f6da2d2e64bce1d3136d3f"},{url:"/images/android-icon-512x512.png",revision:"9f29f1d7c8f6da2d2e64bce1d3136d3f"},{url:"/images/apple-icon-16x16.png",revision:"5998cde017dee1b68827ac575ce6a300"},{url:"/images/apple-icon-32x32.png",revision:"2a82680a8c270c3ad4b8341f5ef897f8"},{url:"/images/apple-icon.png",revision:"538a91302401ac461adfe1b509181921"},{url:"/images/favicon.png",revision:"4f1cb2cac2370cd5050681232e8575a8"},{url:"/images/icon.png",revision:"4e3f888fc8475f69fd5fa32f1ad5216a"},{url:"/images/safari-pinned-tab.svg",revision:"5876746bbc008fdab40fd1abf568ca6b"},{url:"/images/share.png",revision:"f04a8d2b41543ef4669c07e6d04e2d94"},{url:"/images/splash.png",revision:"4dc203c1f48ad8b1e9734613e88be661"},{url:"/manifest.json",revision:"82eda78286b3b0681f7ed7cb7c3a5a34"},{url:"/vercel.svg",revision:"26bf2d0adaf1028a4d4c6ee77005e819"}],{ignoreURLParametersMatching:[/^utm_/,/^fbclid$/]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({response:e})=>e&&"opaqueredirect"===e.type?new Response(e.body,{status:200,statusText:"OK",headers:e.headers}):e}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:2592e3})]}),"GET"),e.registerRoute(/\/_next\/static.+\.js$/i,new e.CacheFirst({cacheName:"next-static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4|webm)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:48,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({sameOrigin:e,url:{pathname:s}})=>!(!e||s.startsWith("/api/auth/callback")||!s.startsWith("/api/"))),new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({request:e,url:{pathname:s},sameOrigin:a})=>"1"===e.headers.get("RSC")&&"1"===e.headers.get("Next-Router-Prefetch")&&a&&!s.startsWith("/api/")),new e.NetworkFirst({cacheName:"pages-rsc-prefetch",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({request:e,url:{pathname:s},sameOrigin:a})=>"1"===e.headers.get("RSC")&&a&&!s.startsWith("/api/")),new e.NetworkFirst({cacheName:"pages-rsc",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:{pathname:e},sameOrigin:s})=>s&&!e.startsWith("/api/")),new e.NetworkFirst({cacheName:"pages",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({sameOrigin:e})=>!e),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")}));
tamagui.css ADDED
The diff for this file is too large to render. See raw diff
 
workbox-cb82a8da.js β†’ workbox-c06b064f.js RENAMED
File without changes