Upload 4 files
Browse files
Dockerfile
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:lts-alpine AS build
|
| 2 |
+
|
| 3 |
+
# 添加 git,以便之后能从GitHub克隆项目
|
| 4 |
+
RUN apk --no-cache add git
|
| 5 |
+
|
| 6 |
+
# 从 GitHub 克隆项目到 /app 目录下
|
| 7 |
+
RUN git clone https://github.com/Dooy/chatgpt-web-midjourney-proxy.git /app
|
| 8 |
+
COPY ./logo.png /app/web/src/assets/logo.png
|
| 9 |
+
COPY ./logo.png /app/web/src/public/favicon.ico
|
| 10 |
+
COPY ./home.vue /app/web/src/pages/home.vue
|
| 11 |
+
|
| 12 |
+
#COPY . /app
|
| 13 |
+
|
| 14 |
+
# RUN yarn config set registry https://mirrors.cloud.tencent.com/npm/
|
| 15 |
+
|
| 16 |
+
WORKDIR /app
|
| 17 |
+
RUN yarn install && yarn run build
|
| 18 |
+
|
| 19 |
+
WORKDIR /app/web
|
| 20 |
+
RUN yarn install && yarn run build
|
| 21 |
+
|
| 22 |
+
FROM node:20-alpine
|
| 23 |
+
WORKDIR /app
|
| 24 |
+
|
| 25 |
+
# Install dotenvx
|
| 26 |
+
RUN curl -fsS https://dotenvx.sh/ | sh
|
| 27 |
+
|
| 28 |
+
COPY .env /app
|
| 29 |
+
|
| 30 |
+
COPY --from=build /app/dist ./dist
|
| 31 |
+
COPY --from=build /app/backend ./backend
|
| 32 |
+
COPY --from=build /app/web/build ./web/build
|
| 33 |
+
COPY --from=build /app/package.json ./
|
| 34 |
+
|
| 35 |
+
# RUN yarn config set registry https://mirrors.cloud.tencent.com/npm/
|
| 36 |
+
RUN yarn install --production && yarn cache clean
|
| 37 |
+
|
| 38 |
+
EXPOSE 3000
|
| 39 |
+
CMD yarn run start
|
README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: sai
|
| 3 |
+
emoji: 🌍
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
+
license: mit
|
| 9 |
---
|
| 10 |
|
|
|
home.vue
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<template>
|
| 2 |
+
<div id="home" class="flex size-full items-center justify-center dark:bg-black">
|
| 3 |
+
<div class="mt-36 flex w-full flex-col gap-4 p-4 sm:-mt-28 lg:max-w-3xl xl:max-w-4xl">
|
| 4 |
+
<div class="flex items-center justify-center gap-2">
|
| 5 |
+
<img :src="logoUrl" class="w-10" />
|
| 6 |
+
<span class="text-3xl font-bold dark:text-gray-100">AI Search</span>
|
| 7 |
+
<t-tag variant="light" class="text-xs text-gray-500"></t-tag>
|
| 8 |
+
</div>
|
| 9 |
+
<SearchInputBar :autofocus="true" :loading="false" @search="search" />
|
| 10 |
+
<div class="my-2 flex flex-wrap items-center justify-center gap-4">
|
| 11 |
+
<SearchMode />
|
| 12 |
+
<SearCategory v-if="enableAdvanced" />
|
| 13 |
+
</div>
|
| 14 |
+
<div class="flex w-full justify-center">
|
| 15 |
+
<div class="flex flex-wrap justify-center gap-2">
|
| 16 |
+
<t-tag
|
| 17 |
+
v-for="(item, index) in list"
|
| 18 |
+
:key="index" shape="round"
|
| 19 |
+
variant="outline"
|
| 20 |
+
size="medium"
|
| 21 |
+
class="cursor-pointer hover:opacity-80"
|
| 22 |
+
@click="onQuickSearch(item)"
|
| 23 |
+
>
|
| 24 |
+
{{ item }} <RiSearch2Line class="ml-1" size="12"/>
|
| 25 |
+
</t-tag>
|
| 26 |
+
</div>
|
| 27 |
+
</div>
|
| 28 |
+
<div class="mt-4">
|
| 29 |
+
<PageFooter />
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
</template>
|
| 34 |
+
|
| 35 |
+
<script setup lang="tsx">
|
| 36 |
+
import router from '../router';
|
| 37 |
+
import { RiSearch2Line } from '@remixicon/vue';
|
| 38 |
+
import { PageFooter, SearchInputBar, SearCategory, SearchMode } from '../components';
|
| 39 |
+
import logoUrl from '../assets/logo.png';
|
| 40 |
+
import { useI18n } from 'vue-i18n';
|
| 41 |
+
import { computed } from 'vue';
|
| 42 |
+
import { useAppStore } from '../store';
|
| 43 |
+
|
| 44 |
+
const { locale } = useI18n();
|
| 45 |
+
const appStore = useAppStore();
|
| 46 |
+
|
| 47 |
+
const enableAdvanced = computed(() => appStore.engine === 'SEARXNG');
|
| 48 |
+
|
| 49 |
+
const quickly: Record<string, string[]> = {
|
| 50 |
+
zh: [
|
| 51 |
+
'刘亦菲《玫瑰的故事》',
|
| 52 |
+
'怎么使用Ollama在本地部署大模型?',
|
| 53 |
+
'llama3-70b需要什么硬件配置?',
|
| 54 |
+
'小米su7体验怎么样?',
|
| 55 |
+
'《庆余年2》大结局'
|
| 56 |
+
],
|
| 57 |
+
en: [
|
| 58 |
+
'What is LLM?',
|
| 59 |
+
'What is RAG?',
|
| 60 |
+
'How to use LLM in enterprise?'
|
| 61 |
+
]
|
| 62 |
+
};
|
| 63 |
+
|
| 64 |
+
const list = computed(() => {
|
| 65 |
+
const key = locale.value;
|
| 66 |
+
return quickly[key];
|
| 67 |
+
});
|
| 68 |
+
|
| 69 |
+
const search = (val: string) => {
|
| 70 |
+
if (!val) {
|
| 71 |
+
return;
|
| 72 |
+
}
|
| 73 |
+
router.push({
|
| 74 |
+
name: 'SearchPage',
|
| 75 |
+
query: {
|
| 76 |
+
q: val
|
| 77 |
+
}
|
| 78 |
+
});
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
const onQuickSearch = (val: string) => {
|
| 82 |
+
search(val);
|
| 83 |
+
};
|
| 84 |
+
</script>
|
| 85 |
+
|
| 86 |
+
<script lang="tsx">
|
| 87 |
+
export default {
|
| 88 |
+
name: 'HomePage'
|
| 89 |
+
};
|
| 90 |
+
</script>
|
logo.png
ADDED
|