Rizonando commited on
Commit
c667b6a
路
verified 路
1 Parent(s): 5cb1369

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -1,9 +1,9 @@
1
  import gradio as gr
2
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
3
 
4
- # Carga el modelo y tokenizador antes de definir la funci贸n
5
- tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-base")
6
- model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")
7
 
8
  def responder(texto):
9
  inputs = tokenizer(texto, return_tensors="pt")
@@ -15,10 +15,9 @@ iface = gr.Interface(
15
  fn=responder,
16
  inputs=gr.Textbox(lines=2, placeholder="Escribe tu pregunta aqu铆..."),
17
  outputs="text",
18
- title="Smart Bot - Chat con FLAN-T5-Base",
19
- description="Un chatbot simple usando google/flan-t5-base en Hugging Face Spaces."
20
  )
21
 
22
  if __name__ == "__main__":
23
  iface.launch()
24
-
 
1
  import gradio as gr
2
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
3
 
4
+ # Carga modelo y tokenizador
5
+ tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")
6
+ model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")
7
 
8
  def responder(texto):
9
  inputs = tokenizer(texto, return_tensors="pt")
 
15
  fn=responder,
16
  inputs=gr.Textbox(lines=2, placeholder="Escribe tu pregunta aqu铆..."),
17
  outputs="text",
18
+ title="Smart Bot - Chat con FLAN-T5-Small",
19
+ description="Chatbot liviano con modelo FLAN-T5-Small en Hugging Face Spaces."
20
  )
21
 
22
  if __name__ == "__main__":
23
  iface.launch()