Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,9 +23,13 @@ TEXT_CLASS_MAPPING = {
|
|
23 |
}
|
24 |
|
25 |
def update_language(language):
|
26 |
-
if language == '
|
27 |
return gr.update(language='python')
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
|
30 |
def process_result_detection_tab(text, language):
|
31 |
result = classifier(f"Language: {language}\n\n{text}")[0]
|
@@ -51,9 +55,9 @@ with gr.Blocks() as demo:
|
|
51 |
|
52 |
with gr.Row():
|
53 |
language = gr.Dropdown(
|
54 |
-
choices=["
|
55 |
label="Select Programming Language",
|
56 |
-
value="
|
57 |
)
|
58 |
|
59 |
with gr.Row():
|
|
|
23 |
}
|
24 |
|
25 |
def update_language(language):
|
26 |
+
if language == 'Java' or language == 'Python':
|
27 |
return gr.update(language='python')
|
28 |
+
elif language == 'C':
|
29 |
+
return gr.update(language='c')
|
30 |
+
elif language == 'C++':
|
31 |
+
return gr.update(language='cpp')
|
32 |
+
return gr.update(language='python')
|
33 |
|
34 |
def process_result_detection_tab(text, language):
|
35 |
result = classifier(f"Language: {language}\n\n{text}")[0]
|
|
|
55 |
|
56 |
with gr.Row():
|
57 |
language = gr.Dropdown(
|
58 |
+
choices=["C", "C++", "Java", "Python"],
|
59 |
label="Select Programming Language",
|
60 |
+
value="C"
|
61 |
)
|
62 |
|
63 |
with gr.Row():
|