Spaces:
Sleeping
Sleeping
Seungwoo hong
commited on
Commit
ยท
30d7adf
1
Parent(s):
8730707
๐ fix: Update Dockerfile to use python:3.10-slim instead of python:3.9 and add comments about Docker execution
Browse filesfeat: Add AutoRAG integration in app.py, import AutoRAG package, display AutoRAG version, and provide space for additional AutoRAG functionality
- Dockerfile +4 -1
- app.py +12 -1
- requirements.txt +1 -0
Dockerfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
# you will also find guides on how best to write your Dockerfile
|
3 |
|
4 |
-
FROM python:3.
|
5 |
|
6 |
RUN useradd -m -u 1000 user
|
7 |
USER user
|
@@ -12,5 +12,8 @@ WORKDIR /app
|
|
12 |
COPY --chown=user ./requirements.txt requirements.txt
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
|
|
|
|
|
|
15 |
COPY --chown=user . /app
|
16 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
# you will also find guides on how best to write your Dockerfile
|
3 |
|
4 |
+
FROM python:3.10-slim
|
5 |
|
6 |
RUN useradd -m -u 1000 user
|
7 |
USER user
|
|
|
12 |
COPY --chown=user ./requirements.txt requirements.txt
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
15 |
+
|
16 |
+
# ๋์ปค ์คํ
|
17 |
+
|
18 |
COPY --chown=user . /app
|
19 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
@@ -1,7 +1,18 @@
|
|
1 |
from fastapi import FastAPI
|
|
|
2 |
|
3 |
app = FastAPI()
|
4 |
|
5 |
@app.get("/")
|
6 |
def greet_json():
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from fastapi import FastAPI
|
2 |
+
import autorag # AutoRAG ํจํค์ง๋ฅผ import ํฉ๋๋ค. ์ค์ ํจํค์ง ์ด๋ฆ์ ๋ค๋ฅผ ์ ์์ต๋๋ค.
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
@app.get("/")
|
7 |
def greet_json():
|
8 |
+
# AutoRAG๋ฅผ ์คํํ๊ณ ๋ฒ์ ์ ์ถ๋ ฅ
|
9 |
+
autorag_version = autorag.__version__ # AutoRAG์ ๋ฒ์ ์ ๊ฐ์ ธ์ต๋๋ค.
|
10 |
+
|
11 |
+
# ์ฌ๊ธฐ์ AutoRAG๋ฅผ ์คํํ๋ ์ฝ๋๋ฅผ ์ถ๊ฐํ ์ ์์ต๋๋ค.
|
12 |
+
# ์: result = autorag.run_some_function()
|
13 |
+
|
14 |
+
return {
|
15 |
+
"Hello": "AutoRAG World!",
|
16 |
+
"AutoRAG Version": autorag_version,
|
17 |
+
# "AutoRAG Result": result # AutoRAG ์คํ ๊ฒฐ๊ณผ๋ฅผ ํฌํจํ ์ ์์ต๋๋ค.
|
18 |
+
}
|
requirements.txt
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
fastapi
|
2 |
uvicorn[standard]
|
|
|
|
1 |
fastapi
|
2 |
uvicorn[standard]
|
3 |
+
Autorag
|