Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
@@ -345,7 +345,7 @@ app.use(cors({
|
|
345 |
}));
|
346 |
|
347 |
// 获取模型列表路由
|
348 |
-
app.get('/v1/models', (req, res) => {
|
349 |
res.json({
|
350 |
object: "list",
|
351 |
data: [{
|
@@ -358,7 +358,7 @@ app.get('/v1/models', (req, res) => {
|
|
358 |
});
|
359 |
|
360 |
// 聊天完成路由
|
361 |
-
app.post('/v1/chat/completions', async (req, res) => {
|
362 |
try {
|
363 |
const { messages, model, stream } = req.body;
|
364 |
const authToken = req.headers.authorization?.replace('Bearer ', '');
|
|
|
345 |
}));
|
346 |
|
347 |
// 获取模型列表路由
|
348 |
+
app.get('/hf/v1/models', (req, res) => {
|
349 |
res.json({
|
350 |
object: "list",
|
351 |
data: [{
|
|
|
358 |
});
|
359 |
|
360 |
// 聊天完成路由
|
361 |
+
app.post('/hf/v1/chat/completions', async (req, res) => {
|
362 |
try {
|
363 |
const { messages, model, stream } = req.body;
|
364 |
const authToken = req.headers.authorization?.replace('Bearer ', '');
|