Spaces:
Running
Running
Update index.html
Browse files- index.html +23 -1
index.html
CHANGED
@@ -3,9 +3,17 @@
|
|
3 |
<head>
|
4 |
<meta charset="utf-8" />
|
5 |
<meta name="viewport" content="width=device-width" />
|
6 |
-
<title>
|
7 |
<link rel="stylesheet" href="style.css" />
|
8 |
</head>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
<body>
|
10 |
<div class="card">
|
11 |
<h1>Welcome to your static Space!</h1>
|
@@ -15,5 +23,19 @@
|
|
15 |
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
16 |
</p>
|
17 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
</body>
|
19 |
</html>
|
|
|
3 |
<head>
|
4 |
<meta charset="utf-8" />
|
5 |
<meta name="viewport" content="width=device-width" />
|
6 |
+
<title>T5-base Language Translator</title>
|
7 |
<link rel="stylesheet" href="style.css" />
|
8 |
</head>
|
9 |
+
<script type="importmap">
|
10 |
+
{
|
11 |
+
"imports": {
|
12 |
+
"@huggingface/inference":"https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm"
|
13 |
+
}
|
14 |
+
}
|
15 |
+
</script>
|
16 |
+
|
17 |
<body>
|
18 |
<div class="card">
|
19 |
<h1>Welcome to your static Space!</h1>
|
|
|
23 |
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
24 |
</p>
|
25 |
</div>
|
26 |
+
<script>
|
27 |
+
import { HfInference } from '@huggingface/inference';
|
28 |
+
import { promises as fsPromises } from 'fs';
|
29 |
+
//import dotenv from "dotenv";
|
30 |
+
//dotenv.config();
|
31 |
+
|
32 |
+
const hf = new HfInference();
|
33 |
+
// You can also omit "model" to use the recommended model for the task
|
34 |
+
const result_tr = await hf.translation({
|
35 |
+
model: 't5-base',
|
36 |
+
inputs: 'My name is Wolfgang and I live in Berlin',
|
37 |
+
});
|
38 |
+
console.log(result_tr);
|
39 |
+
</script>
|
40 |
</body>
|
41 |
</html>
|