text: from django.shortcuts import render, redirect
  from django.http import HttpResponse, HttpResponseRedirect
  from django.urls import reverse
  from django.views.generic import ListView
  from .apps import PredictorConfig
  from .forms import DocumentForm
  from .models import Document
  from .Metadata import getmetadata
  import warnings
  from .predict import predict_gen
  from django.contrib import messages
  warnings.simplefilter('ignore')
  
  class IndexView(ListView):
      template_name= 'music/index.html'
      def get_queryset(self):
          return True
  
  def model_form_upload(request):
  
      documents = Document.objects.all()
      if request.method == 'POST':
          if len(request.FILES) == 0:
              messages.error(request,'Upload a file')
              return redirect("predictor:index")
  
          form = DocumentForm(request.POST, request.FILES)
          if form.is_valid():
              uploadfile = request.FILES['document']
              print(uploadfile.name)
              print(uploadfile.size)
              if not uploadfile.name.endswith('.wav'):
                  messages.error(request,'Only .wav file type is allowed')
                  return redirect("predictor:index")
              meta = getmetadata(uploadfile)
              
              genre = predict_gen(meta)
              print(genre)
  
              context = {'genre':genre}
              return render(request,'music/result.html',context)
  
      else:
          form = DocumentForm()
  
      return render(request,'music/result.html',{'documents':documents,'form':form})