22 lines
395 B
TypeScript
22 lines
395 B
TypeScript
const url = "http://10.39.39.9:7999/v1/embeddings";
|
|
|
|
const input: string[] = [];
|
|
for (let i = 0; i < 1000; i++) {
|
|
input.push("我是一名大学生");
|
|
}
|
|
|
|
const resp = await fetch(url, {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: JSON.stringify({
|
|
model: "acge-large-zh",
|
|
input,
|
|
}),
|
|
});
|
|
|
|
const result = await resp.json();
|
|
|
|
console.log(result);
|