Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,27 +1,3 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
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("### XVCLM Code Explanation Chatbot")
|
10 |
-
|
11 |
-
with gr.Row():
|
12 |
-
with gr.Column():
|
13 |
-
chatbox = gr.Chatbot()
|
14 |
-
code_input = gr.Textbox(placeholder="Enter your code snippet here...", label="Code Snippet")
|
15 |
-
|
16 |
-
with gr.Column():
|
17 |
-
submit_button = gr.Button("Explain Code")
|
18 |
-
|
19 |
-
def respond(code):
|
20 |
-
explanation = explain_code(code)
|
21 |
-
chatbox.append(("User", code))
|
22 |
-
chatbox.append(("XVCLM", explanation))
|
23 |
-
return chatbox
|
24 |
-
|
25 |
-
submit_button.click(respond, inputs=code_input, outputs=chatbox)
|
26 |
-
|
27 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
gr.load("models/Binarybardakshat/XVCLM-MIN-DECT").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|