prol99 commited on
Commit
358ae90
verified
1 Parent(s): 1d0059e

Upload 2 files

Browse files
Files changed (1) hide show
  1. app.py +2 -13
app.py CHANGED
@@ -1,19 +1,8 @@
1
- import os
2
-
3
- # Eliminar posibles instalaciones corruptas
4
- os.system("pip uninstall -y transformers gradio torch torchvision torchaudio sentencepiece")
5
-
6
- # Instalar nuevamente sin errores
7
- os.system("pip install transformers gradio torch torchvision torchaudio sentencepiece")
8
-
9
-
10
  import gradio as gr
11
  from transformers import pipeline
12
 
13
  # Cargar el modelo
14
- print("Cargando el modelo...")
15
  model = pipeline("translation", model="projecte-aina/aina-translator-es-ast")
16
- print("Modelo cargado con 茅xito.")
17
 
18
  # Funci贸n para traducir
19
  def translate(text):
@@ -26,5 +15,5 @@ interface = gr.Interface(
26
  outputs=gr.Textbox(label="Traducci贸n al asturiano")
27
  )
28
 
29
- print("Lanzando Gradio...")
30
- interface.launch(debug=True)
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
  # Cargar el modelo
 
5
  model = pipeline("translation", model="projecte-aina/aina-translator-es-ast")
 
6
 
7
  # Funci贸n para traducir
8
  def translate(text):
 
15
  outputs=gr.Textbox(label="Traducci贸n al asturiano")
16
  )
17
 
18
+ # Lanzar la interfaz
19
+ interface.launch(debug=True, share=True)