import { Highlighter, Snippet, TabsNav } from '@bentwnghk/ui'; import { Steps } from 'antd'; import { createStyles } from 'antd-style'; import Link from 'next/link'; import { readableColor } from 'polished'; import { memo } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Flexbox } from 'react-layout-kit'; const useStyles = createStyles(({ css, prefixCls, token }) => ({ steps: css` margin-block-start: 32px; &.${prefixCls}-steps-small .${prefixCls}-steps-item-title { margin-block-end: 16px; font-size: 16px; font-weight: bold; } .${prefixCls}-steps-item-description { margin-block-end: 24px; } .${prefixCls}-steps-icon { color: ${readableColor(token.colorPrimary)} !important; } `, })); const SetupGuide = memo(() => { const { styles } = useStyles(); const { t } = useTranslation('components'); return ( 请确认你已经开启 Ollama ,如果没有安装 Ollama ,请前往官网 下载 ), status: 'process', title: t('OllamaSetupGuide.install.title'), }, { description: ( {t('OllamaSetupGuide.cors.description')} {t('OllamaSetupGuide.cors.macos')} {/* eslint-disable-next-line react/no-unescaped-entities */} launchctl setenv OLLAMA_ORIGINS "*" {t('OllamaSetupGuide.cors.reboot')} ), status: 'process', title: t('OllamaSetupGuide.cors.title'), }, ]} size={'small'} /> ), key: 'macos', label: 'macOS', }, { children: ( 请确认你已经开启 Ollama ,如果没有安装 Ollama ,请前往官网 下载 ), status: 'process', title: t('OllamaSetupGuide.install.title'), }, { description: ( {t('OllamaSetupGuide.cors.description')}
{t('OllamaSetupGuide.cors.windows')}
{t('OllamaSetupGuide.cors.reboot')}
), status: 'process', title: t('OllamaSetupGuide.cors.title'), }, ]} size={'small'} /> ), key: 'windows', label: t('OllamaSetupGuide.install.windowsTab'), }, { children: ( {t('OllamaSetupGuide.install.linux.command')} curl -fsSL https://ollama.com/install.sh | sh
或者,你也可以参考 Linux 手动安装指南 。
), status: 'process', title: t('OllamaSetupGuide.install.title'), }, { description: (
{t('OllamaSetupGuide.cors.description')}
{t('OllamaSetupGuide.cors.linux.systemd')}
{/* eslint-disable-next-line react/no-unescaped-entities */} sudo systemctl edit ollama.service {t('OllamaSetupGuide.cors.linux.env')} {t('OllamaSetupGuide.cors.linux.reboot')}
), status: 'process', title: t('OllamaSetupGuide.cors.title'), }, ]} size={'small'} /> ), key: 'linux', label: 'Linux', }, { children: ( {t('OllamaSetupGuide.install.description')}
{t('OllamaSetupGuide.install.docker')}
docker pull ollama/ollama ), status: 'process', title: t('OllamaSetupGuide.install.title'), }, { description: ( {t('OllamaSetupGuide.cors.description')} {/* eslint-disable-next-line react/no-unescaped-entities */} docker run -d --gpus=all -v ollama:/root/.ollama -e OLLAMA_ORIGINS="*" -p 11434:11434 --name ollama ollama/ollama ), status: 'process', title: t('OllamaSetupGuide.cors.title'), }, ]} size={'small'} /> ), key: 'docker', label: 'Docker', }, ]} /> ); }); export default SetupGuide;