Spaces:
Running
Running
Binarybardakshat
commited on
Commit
•
d85aa87
1
Parent(s):
e81f6db
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,4 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
def explain_code(code_input):
|
4 |
-
model = gr.load("models/Binarybardakshat/XVCLM-MIN-DECT")
|
5 |
-
response = model(code_input)
|
6 |
-
return response[0]['generated_text']
|
7 |
-
|
8 |
with gr.Blocks() as demo:
|
9 |
gr.Markdown(
|
10 |
"""
|
@@ -15,21 +9,7 @@ with gr.Blocks() as demo:
|
|
15 |
[Medium](https://medium.com/@binarybardakshat)
|
16 |
"""
|
17 |
)
|
18 |
-
|
19 |
-
with gr.Row():
|
20 |
-
with gr.Column():
|
21 |
-
chatbox = gr.Chatbot()
|
22 |
-
code_input = gr.Textbox(placeholder="Enter your code snippet here...", label="Code Snippet")
|
23 |
-
|
24 |
-
with gr.Column():
|
25 |
-
submit_button = gr.Button("Explain Code")
|
26 |
-
|
27 |
-
def respond(code):
|
28 |
-
explanation = explain_code(code)
|
29 |
-
chatbox.append(("User", code))
|
30 |
-
chatbox.append(("XVCLM", explanation))
|
31 |
-
return chatbox
|
32 |
-
|
33 |
-
submit_button.click(respond, inputs=code_input, outputs=chatbox)
|
34 |
|
35 |
-
|
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
with gr.Blocks() as demo:
|
3 |
gr.Markdown(
|
4 |
"""
|
|
|
9 |
[Medium](https://medium.com/@binarybardakshat)
|
10 |
"""
|
11 |
)
|
12 |
+
gr.load("models/Binarybardakshat/XVCLM-MIN-DECT").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
+
|
15 |
+
|