Spaces:
Running
Running
Commit
•
b1c92f3
1
Parent(s):
e9b070c
Update index.html
Browse files- index.html +45 -18
index.html
CHANGED
@@ -1,30 +1,57 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
-
<title>
|
|
|
5 |
</head>
|
6 |
<body>
|
7 |
<div id="my_gradio_app">
|
8 |
-
<!-- The embedded
|
9 |
</div>
|
10 |
<script>
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
|
16 |
-
return code_completion(input_code, max_length=50, num_return_sequences=1)[0]['generated_text'];
|
17 |
-
};
|
18 |
-
|
19 |
-
const iface = gr.Interface({
|
20 |
-
generate_code: generate_code
|
21 |
-
}, {
|
22 |
-
inputs: gr.inputs.Textbox({label: "Enter your code snippet"}),
|
23 |
-
outputs: gr.outputs.Textbox({label: "Generated Code"}),
|
24 |
-
title: "Code Completion Assistant"
|
25 |
-
});
|
26 |
-
|
27 |
-
// Render the embedded code completion assistant
|
28 |
iface.mount("my_gradio_app");
|
29 |
</script>
|
30 |
</body>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
+
<title>FragMixt: Your AI-Powered Coding Assistant</title>
|
5 |
+
<script src="https://cdn.jsdelivr.net/npm/@gradio/gradio@latest/gradio.min.js"></script>
|
6 |
</head>
|
7 |
<body>
|
8 |
<div id="my_gradio_app">
|
9 |
+
<!-- The embedded FragMixt app will be displayed here -->
|
10 |
</div>
|
11 |
<script>
|
12 |
+
const iface = gr.Blocks()
|
13 |
+
.with_tab("Model", [
|
14 |
+
gr.Dropdown(
|
15 |
+
choices=["Code Generation", "Code Explanation", "Code Optimization", "Code Translation"],
|
16 |
+
label="Model Task",
|
17 |
+
value="Code Generation"
|
18 |
+
),
|
19 |
+
gr.Dropdown(
|
20 |
+
choices=[],
|
21 |
+
label="Hugging Face Model"
|
22 |
+
),
|
23 |
+
gr.Button("Load Model"),
|
24 |
+
gr.Textbox(label="Status"),
|
25 |
+
gr.Markdown(label="Model Description")
|
26 |
+
])
|
27 |
+
.with_tab("Code Assistant", [
|
28 |
+
gr.Chatbot(show_label=false, show_share_button=false, show_copy_button=true, likeable=true),
|
29 |
+
gr.Textbox(label="Enter your code or query", placeholder="Ask me anything related to code!"),
|
30 |
+
gr.Dropdown(label="Programming Language", choices=["Python", "JavaScript", "Java", "C++", "C#", "Ruby", "Go", "Rust", "Swift", "Kotlin"], value="Python", interactive=true),
|
31 |
+
gr.Textbox(label="Context", placeholder="Provide any additional context or requirements", max_lines=3, interactive=true),
|
32 |
+
gr.Slider(label="Temperature", minimum=0.0, maximum=1.0, step=0.05, interactive=true, info="Higher values produce more diverse outputs"),
|
33 |
+
gr.Slider(label="Max new tokens", minimum=0, maximum=1048 * 10, step=64, interactive=true, info="The maximum numbers of new tokens"),
|
34 |
+
gr.Slider(label="Top-p (nucleus sampling)", minimum=0.0, maximum=1, step=0.05, interactive=true, info="Higher values sample more low-probability tokens"),
|
35 |
+
gr.Slider(label="Repetition penalty", minimum=1.0, maximum=2.0, step=0.05, interactive=true, info="Penalize repeated tokens"),
|
36 |
+
gr.Button(value="Submit"),
|
37 |
+
gr.State([]),
|
38 |
+
gr.Button(value="+", variant="primary"),
|
39 |
+
])
|
40 |
+
.with_tab("Project", [
|
41 |
+
gr.Textbox(label="Project Name", placeholder="MyCodeProject"),
|
42 |
+
gr.Button("Create Project"),
|
43 |
+
gr.Textbox(label="Output", lines=5),
|
44 |
+
gr.Code(label="Code Editor", language="python", lines=20),
|
45 |
+
gr.Textbox(label="File Path", placeholder="src/main.py"),
|
46 |
+
gr.Button("Read File"),
|
47 |
+
gr.Button("Save File"),
|
48 |
+
gr.Textbox(label="Terminal Command", placeholder="pip install -r requirements.txt"),
|
49 |
+
gr.Textbox(label="Command Output", lines=5),
|
50 |
+
gr.Button("Run Command"),
|
51 |
+
gr.Button("Preview Project")
|
52 |
+
]);
|
53 |
|
54 |
+
// Render the embedded FragMixt app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
iface.mount("my_gradio_app");
|
56 |
</script>
|
57 |
</body>
|