Spaces:
Runtime error
Runtime error
Update index.js
Browse files
index.js
CHANGED
@@ -957,7 +957,7 @@ app.use(cors({
|
|
957 |
allowedHeaders: ['Content-Type', 'Authorization']
|
958 |
}));
|
959 |
|
960 |
-
app.get('/
|
961 |
res.json({
|
962 |
object: "list",
|
963 |
data: Object.keys(tokenManager.tokenModelMap).map((model, index) => ({
|
@@ -969,7 +969,7 @@ app.get('/hf/v1/models', (req, res) => {
|
|
969 |
});
|
970 |
});
|
971 |
|
972 |
-
app.post('/
|
973 |
try {
|
974 |
const authorization = req.headers.authorization?.replace('Bearer ', '');
|
975 |
if (!authorization) {
|
|
|
957 |
allowedHeaders: ['Content-Type', 'Authorization']
|
958 |
}));
|
959 |
|
960 |
+
app.get('/v1/models', (req, res) => {
|
961 |
res.json({
|
962 |
object: "list",
|
963 |
data: Object.keys(tokenManager.tokenModelMap).map((model, index) => ({
|
|
|
969 |
});
|
970 |
});
|
971 |
|
972 |
+
app.post('/v1/chat/completions', async (req, res) => {
|
973 |
try {
|
974 |
const authorization = req.headers.authorization?.replace('Bearer ', '');
|
975 |
if (!authorization) {
|