Spaces:
Sleeping
Sleeping
Commit ·
ecfb822
1
Parent(s): a8396a5
chore: update Dockerfile, TinyLlama converter, vite config for Space
Browse files- Dockerfile +1 -1
- src/components/TinyLlamaConverter.jsx +1 -1
- vite.config.js +1 -1
Dockerfile
CHANGED
|
@@ -48,7 +48,7 @@ RUN echo 'server { \
|
|
| 48 |
location /api/hf-inference/ { \
|
| 49 |
resolver 127.0.0.11 8.8.8.8 valid=30s; \
|
| 50 |
set $hf_upstream https://router.huggingface.co; \
|
| 51 |
-
rewrite ^/api/hf-inference/(.*)$
|
| 52 |
proxy_pass $hf_upstream; \
|
| 53 |
proxy_http_version 1.1; \
|
| 54 |
proxy_set_header Host router.huggingface.co; \
|
|
|
|
| 48 |
location /api/hf-inference/ { \
|
| 49 |
resolver 127.0.0.11 8.8.8.8 valid=30s; \
|
| 50 |
set $hf_upstream https://router.huggingface.co; \
|
| 51 |
+
rewrite ^/api/hf-inference/(.*)$ /$1 break; \
|
| 52 |
proxy_pass $hf_upstream; \
|
| 53 |
proxy_http_version 1.1; \
|
| 54 |
proxy_set_header Host router.huggingface.co; \
|
src/components/TinyLlamaConverter.jsx
CHANGED
|
@@ -46,7 +46,7 @@ const TinyLlamaConverter = ({ addToMessage, sharedInput, setSharedInput }) => {
|
|
| 46 |
try {
|
| 47 |
if (config.provider === 'hf') {
|
| 48 |
const model = config.model ?? HF_MODEL;
|
| 49 |
-
const url = `${config.baseUrl}/
|
| 50 |
const res = await fetch(url, {
|
| 51 |
method: 'POST',
|
| 52 |
headers: { 'Content-Type': 'application/json' },
|
|
|
|
| 46 |
try {
|
| 47 |
if (config.provider === 'hf') {
|
| 48 |
const model = config.model ?? HF_MODEL;
|
| 49 |
+
const url = `${config.baseUrl}/v1/chat/completions`;
|
| 50 |
const res = await fetch(url, {
|
| 51 |
method: 'POST',
|
| 52 |
headers: { 'Content-Type': 'application/json' },
|
vite.config.js
CHANGED
|
@@ -20,7 +20,7 @@ export default defineConfig({
|
|
| 20 |
'/api/hf-inference': {
|
| 21 |
target: 'https://router.huggingface.co',
|
| 22 |
changeOrigin: true,
|
| 23 |
-
rewrite: (path) => path.replace(/^\/api\/hf-inference/, '
|
| 24 |
configure: (proxy) => {
|
| 25 |
const token = process.env.VITE_HF_TOKEN;
|
| 26 |
if (token) {
|
|
|
|
| 20 |
'/api/hf-inference': {
|
| 21 |
target: 'https://router.huggingface.co',
|
| 22 |
changeOrigin: true,
|
| 23 |
+
rewrite: (path) => path.replace(/^\/api\/hf-inference/, ''),
|
| 24 |
configure: (proxy) => {
|
| 25 |
const token = process.env.VITE_HF_TOKEN;
|
| 26 |
if (token) {
|