init
This commit is contained in:
21
tests/deno.ts
Normal file
21
tests/deno.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user