2023-07-18 19:56:43 +00:00
|
|
|
import Header from '../header'
|
2023-07-13 00:26:20 +00:00
|
|
|
import Downloader from './downloader'
|
|
|
|
import Signup from './signup'
|
2023-07-07 20:07:10 +00:00
|
|
|
|
|
|
|
export default async function Download() {
|
2023-07-08 20:47:58 +00:00
|
|
|
const res = await fetch('https://api.github.com/repos/jmorganca/ollama/releases', { next: { revalidate: 60 } })
|
|
|
|
const data = await res.json()
|
|
|
|
|
|
|
|
if (data.length === 0) {
|
2023-07-13 00:26:20 +00:00
|
|
|
return null
|
2023-07-08 20:47:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const latest = data[0]
|
|
|
|
const assets = latest.assets || []
|
|
|
|
|
|
|
|
if (assets.length === 0) {
|
2023-07-13 00:26:20 +00:00
|
|
|
return null
|
2023-07-08 20:47:58 +00:00
|
|
|
}
|
2023-07-07 20:07:10 +00:00
|
|
|
|
|
|
|
// todo: get the correct asset for the current arch/os
|
2023-07-08 20:47:58 +00:00
|
|
|
const asset = assets.find(
|
|
|
|
(a: any) => a.name.toLowerCase().includes('darwin') && a.name.toLowerCase().includes('.zip')
|
|
|
|
)
|
|
|
|
|
|
|
|
if (!asset) {
|
2023-07-13 00:26:20 +00:00
|
|
|
return null
|
2023-07-08 20:47:58 +00:00
|
|
|
}
|
2023-07-07 20:07:10 +00:00
|
|
|
|
2023-07-13 00:26:20 +00:00
|
|
|
return (
|
2023-07-18 19:56:43 +00:00
|
|
|
<>
|
|
|
|
<Header />
|
2023-07-18 20:17:42 +00:00
|
|
|
<main className='flex min-h-screen max-w-6xl flex-col py-20 px-16 lg:p-32 items-center mx-auto'>
|
2023-07-18 19:56:43 +00:00
|
|
|
<img src='/ollama.png' className='w-16 h-auto' />
|
|
|
|
<section className='mt-12 mb-8 text-center'>
|
|
|
|
<h2 className='my-2 max-w-md text-3xl tracking-tight'>Downloading...</h2>
|
|
|
|
<h3 className='text-base text-neutral-500 mt-12 max-w-[16rem]'>
|
|
|
|
While Ollama downloads, sign up to get notified of new updates.
|
|
|
|
</h3>
|
2023-07-18 19:57:39 +00:00
|
|
|
<Downloader url={asset.browser_download_url} />
|
2023-07-18 19:56:43 +00:00
|
|
|
</section>
|
2023-07-13 00:26:20 +00:00
|
|
|
<Signup />
|
2023-07-18 19:56:43 +00:00
|
|
|
</main>
|
|
|
|
</>
|
2023-07-13 00:26:20 +00:00
|
|
|
)
|
2023-07-07 20:07:10 +00:00
|
|
|
}
|