Santenana commited on
Commit
2cde552
·
1 Parent(s): 801e86d

Por dios ojala que este si :'c

Browse files
Files changed (1) hide show
  1. app.py +0 -25
app.py CHANGED
@@ -1,29 +1,4 @@
1
- inception_net = tf.keras.applications.MobileNetV2()
2
- respuesta = requests.get("https://git.io/JJKYN")
3
- etiquetas = respuesta.text.split("\n")
4
-
5
- trans = pipeline("automatic-speech-recognition",model="facebook/wav2vec2-large-xlsr-53-spanish")
6
- clasificador = pipeline('text-classification',model="pysentimiento/robertuito-sentiment-analysis")
7
-
8
- def transcribe(audio):
9
- text = trans(audio)["text"]
10
- return text
11
-
12
- def clasificacion(text):
13
- return clasificador(text)[0]["label"]
14
-
15
-
16
- def clasifica_imagen(inp):
17
- inp = inp.reshape((-1224,224,3))
18
- inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
19
- prediction = inception_net.predict(inp).flatten()
20
- confidences = {etiquetas[i]:float(prediction[i]) for i in range(1000)}
21
- return confidences
22
-
23
- import gradio as gr
24
-
25
  demo = gr.Blocks()
26
-
27
  with demo:
28
  gr.Markdown("Clasificacion de Audio a Sentimientos")
29
  with gr.Tabs():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  demo = gr.Blocks()
 
2
  with demo:
3
  gr.Markdown("Clasificacion de Audio a Sentimientos")
4
  with gr.Tabs():