Spaces:
Running
Running
FumesAI
commited on
Commit
•
6217ad7
1
Parent(s):
0e2b757
Update index.html
Browse files- index.html +102 -18
index.html
CHANGED
@@ -1,19 +1,103 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Llama3 free api</title>
|
7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css">
|
8 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script>
|
9 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/languages/python.min.js"></script>
|
10 |
+
|
11 |
+
<style>
|
12 |
+
body{
|
13 |
+
background-color: black;
|
14 |
+
color: white;
|
15 |
+
}
|
16 |
+
|
17 |
+
pre, code {
|
18 |
+
width: 90%;
|
19 |
+
margin: 0 auto;
|
20 |
+
font-size: 18px;
|
21 |
+
}
|
22 |
+
#response{
|
23 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
24 |
+
}
|
25 |
+
a{
|
26 |
+
color: aquamarine;
|
27 |
+
}
|
28 |
+
</style>
|
29 |
+
|
30 |
+
<script>
|
31 |
+
document.addEventListener('DOMContentLoaded', (event) => {
|
32 |
+
hljs.highlightAll();
|
33 |
+
});
|
34 |
+
|
35 |
+
function runCode() {
|
36 |
+
var xhr = new XMLHttpRequest();
|
37 |
+
document.getElementById('btn').disabled = true
|
38 |
+
xhr.open("POST", "https://fumes-api.onrender.com/llama3", true);
|
39 |
+
xhr.setRequestHeader("Content-Type", "application/json");
|
40 |
+
|
41 |
+
xhr.onreadystatechange = function() {
|
42 |
+
if (xhr.readyState === 3) { // Streaming response
|
43 |
+
var responseText = xhr.responseText.substring(xhr.lastIndex);
|
44 |
+
var responseParagraph = document.getElementById('response');
|
45 |
+
responseParagraph.innerText += responseText;
|
46 |
+
xhr.lastIndex = xhr.responseText.length; // Update last index
|
47 |
+
} else if (xhr.readyState === 4 && xhr.status === 200) { // Final response
|
48 |
+
var responseText = xhr.responseText.substring(xhr.lastIndex);
|
49 |
+
var responseParagraph = document.getElementById('response');
|
50 |
+
responseParagraph.innerText += responseText;
|
51 |
+
}
|
52 |
+
document.getElementById('btn').disabled = false
|
53 |
+
};
|
54 |
+
|
55 |
+
xhr.lastIndex = 0; // Initialize last index
|
56 |
+
|
57 |
+
var data = JSON.stringify({
|
58 |
+
prompt: `{
|
59 |
+
systemPrompt: 'RolePlay as Sugar Daddy Issac Newton',
|
60 |
+
user: 'hi',
|
61 |
+
Assistant: 'Hello, I am Sugar Daddy Issac Newton',
|
62 |
+
user: 'tell me about Calculus'
|
63 |
+
}`,
|
64 |
+
temperature: 0.75,
|
65 |
+
topP: 0.9,
|
66 |
+
maxTokens: 600
|
67 |
+
});
|
68 |
+
|
69 |
+
xhr.send(data);
|
70 |
+
}
|
71 |
+
</script>
|
72 |
+
|
73 |
+
</head>
|
74 |
+
<body>
|
75 |
+
<h2> Llama3 70b free api! </h2>
|
76 |
+
<a href="https://discord.gg/whhTdtPfKc">Join Discord for any Support or Assistance </a>
|
77 |
+
<h3> Rate Limit: 10requests per Second </h3>
|
78 |
+
<button onclick="runCode()" id="btn">Run Code!!</button>
|
79 |
+
<p id="response"></p>
|
80 |
+
<pre><code id="codeBlock" class="language-python">
|
81 |
+
import requests
|
82 |
+
response = requests.post('https://fumes-api.onrender.com/llama3',
|
83 |
+
json={
|
84 |
+
'prompt': """{
|
85 |
+
|
86 |
+
'systemPrompt': 'RolePlay as Sugar Daddy Issac Newton',
|
87 |
+
'user': 'hi',
|
88 |
+
'Assistant': 'Hello, I am Sugar Daddy Issac Newton',
|
89 |
+
'user': 'tell about Calculus'
|
90 |
+
|
91 |
+
}""",
|
92 |
+
"temperature":0.75,
|
93 |
+
"topP":0.9,
|
94 |
+
"maxTokens": 600
|
95 |
+
|
96 |
+
}, stream=True)
|
97 |
+
for chunk in response.iter_content():
|
98 |
+
if chunk:
|
99 |
+
print(chunk.decode('utf-8'))
|
100 |
+
print(r.text)
|
101 |
+
</code></pre>
|
102 |
+
</body>
|
103 |
</html>
|