Spaces:
Sleeping
Sleeping
ffreemt
commited on
Commit
•
69ddcdf
1
Parent(s):
2160552
Update
Browse files- Dockerfile +1 -0
- duck2api_fwd.py +3 -2
Dockerfile
CHANGED
@@ -27,6 +27,7 @@ WORKDIR /app
|
|
27 |
|
28 |
# 从构建阶段复制编译好的应用和资源
|
29 |
COPY --from=builder /app/duck2api /app/duck2api
|
|
|
30 |
|
31 |
COPY . .
|
32 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
27 |
|
28 |
# 从构建阶段复制编译好的应用和资源
|
29 |
COPY --from=builder /app/duck2api /app/duck2api
|
30 |
+
ENV PIP_ROOT_USER_ACTION=ignore
|
31 |
|
32 |
COPY . .
|
33 |
RUN pip install --no-cache-dir -r requirements.txt
|
duck2api_fwd.py
CHANGED
@@ -27,7 +27,7 @@ def my_endpoint():
|
|
27 |
url = "https://api.anakin.ai/v1/apps/1344/chatbot/chat"
|
28 |
url = "http://127.0.0.1:8080/v1/chat/completions"
|
29 |
url = "http://acone:8080/v1/chat/completions"
|
30 |
-
|
31 |
# y(request)
|
32 |
# y(request.host)
|
33 |
# y(request.host_url)
|
@@ -40,7 +40,8 @@ def my_endpoint():
|
|
40 |
# 'Authorization': 'Bearer ANAKINAI_API_ACCESS_TOKEN'
|
41 |
}
|
42 |
|
43 |
-
|
|
|
44 |
|
45 |
try:
|
46 |
response = requests.post(url, headers=headers, json=request.json)
|
|
|
27 |
url = "https://api.anakin.ai/v1/apps/1344/chatbot/chat"
|
28 |
url = "http://127.0.0.1:8080/v1/chat/completions"
|
29 |
url = "http://acone:8080/v1/chat/completions"
|
30 |
+
|
31 |
# y(request)
|
32 |
# y(request.host)
|
33 |
# y(request.host_url)
|
|
|
40 |
# 'Authorization': 'Bearer ANAKINAI_API_ACCESS_TOKEN'
|
41 |
}
|
42 |
|
43 |
+
# remove prefix /hf
|
44 |
+
url = f"http://127.0.0.1:8080{request.path[3:]}"
|
45 |
|
46 |
try:
|
47 |
response = requests.post(url, headers=headers, json=request.json)
|