import gradio as gr models=[ "nadiamaqbool81/starcoderbase-1b-hf", "nadiamaqbool81/starcoderbase-1b-hf_python", "nadiamaqbool81/codet5-large-hf", "nadiamaqbool81/codet5-large-hf-python", "nadiamaqbool81/llama-2-7b-int4-java-code-1.178k", "nadiamaqbool81/llama-2-7b-int4-python-code-510" ] names=[ "nadiamaqbool81/starcoderbase-java", "nadiamaqbool81/starcoderbase-python", "nadiamaqbool81/codet5-java", "nadiamaqbool81/codet5-python", "nadiamaqbool81/llama-2-java", "nadiamaqbool81/llama-2-python" ] model_box=[ gr.load(f"models/{models[0]}"), gr.load(f"models/{models[1]}"), gr.load(f"models/{models[2]}"), gr.load(f"models/{models[3]}"), gr.load(f"models/{models[4]}"), gr.load(f"models/{models[5]}"), ] current_model=model_box[0] def the_process(input_text, model_choice): a_variable = model_box[model_choice] output = a_variable(input_text) return(output) gr.HTML("""