Upload folder using huggingface_hub
Browse files- static/index.html +52 -0
- static/style.css +13 -0
static/index.html
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8">
|
5 |
+
<meta name="viewport" content="width=device-width">
|
6 |
+
<title>Sema Translator</title>
|
7 |
+
<link rel="stylesheet" href="style.css" />
|
8 |
+
<py-script src="modules/app.py"></py-script>
|
9 |
+
</head>
|
10 |
+
<body>
|
11 |
+
<div class="Header">
|
12 |
+
<h1>Sema Translator</h1>
|
13 |
+
<p>Unlock the Power of Global Communication with Sema Translator! Seamlessly bridging language barriers. With support for over 200 languages, Sema Translator opens up a realm of possibilities for building truly global applications.</p>
|
14 |
+
|
15 |
+
</div>
|
16 |
+
|
17 |
+
<div class="LanguageDropdown">
|
18 |
+
<h2>Select a Language:</h2>
|
19 |
+
<select id="languageSelect">
|
20 |
+
<!-- Add options dynamically -->
|
21 |
+
</select>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<div class="instructions">
|
25 |
+
<p>Use the following python code to access the api endpoint</p>
|
26 |
+
<pre style="text-align: left;">
|
27 |
+
import requests
|
28 |
+
|
29 |
+
url = "{public_url}/translate/"
|
30 |
+
data = {
|
31 |
+
"userinput": "rũcinĩ rwega, niwokĩra wega?",
|
32 |
+
"target_lang": "eng_Latn",
|
33 |
+
}
|
34 |
+
|
35 |
+
response = requests.post(url, json=data)
|
36 |
+
result = response.json()
|
37 |
+
|
38 |
+
print(result)
|
39 |
+
|
40 |
+
source_language = result['source_language']
|
41 |
+
print("Source Language:", source_language)
|
42 |
+
|
43 |
+
translation = result['translated_text']
|
44 |
+
print("Translated text:", translation)
|
45 |
+
</pre>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<div class="footer">
|
49 |
+
<h1>Created by Lewis Kamau Kiamru</h1>
|
50 |
+
</div>
|
51 |
+
</body>
|
52 |
+
</html>
|
static/style.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.Header {
|
2 |
+
text-align: center;
|
3 |
+
}
|
4 |
+
.LanguageDropdown {
|
5 |
+
text-align: center;
|
6 |
+
}
|
7 |
+
.instructions {
|
8 |
+
background-color: #056e33;
|
9 |
+
padding: 20px;
|
10 |
+
}
|
11 |
+
.footer {
|
12 |
+
text-align: center;
|
13 |
+
}
|