File size: 841 Bytes
da54da6
 
 
67a650b
 
da54da6
 
 
5efa433
da54da6
1
2
3
4
5
6
7
8
9
10
import gradio as gr
from transformers import pipeline

pipe = pipeline(task="text-classification",
                model="mrm8488/codebert-base-finetuned-detect-insecure-code")
gr.Interface.from_pipeline(pipe, 
                           title="Insecure Code Detector",
                           description="Label 1 for insecure code",
                           examples = [['def search(arr, low, high, x): if high >= low: mid = (high + low) // 2 if arr[mid] == x: return mid elif arr[mid] > x: return search(arr, low, mid - 1, x) else: return search(arr, mid + 1, high, x) else: return -1'],["import subprocess def transcode_file(request, filename): command = 'ffmpeg -i '{source}' output_file.mpg'.format(source=filename) subprocess.call(command, shell=True)"]],
                           allow_flagging="never").launch(inbrowser=True)