pp3232133 commited on
Commit
f7b8382
·
1 Parent(s): 0be8229

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -24,10 +24,10 @@ if model_name == "pp3232133/pp3232133-distilgpt2-wikitext2":
24
 
25
  # Funkcja obsługująca wejście i wyjście dla interfejsu Gradio
26
  def chatbot_interface(input_text):
27
- input_ids = tokenizer.encode(input_text, return_tensors="pt")
28
- chatbot_output = model.generate(input_ids, max_length=100)[0]
29
- response = tokenizer.decode(chatbot_output, skip_special_tokens=True)
30
- return response
31
 
32
  # Interfejs Gradio dla chatbota
33
  iface = gr.Interface(
 
24
 
25
  # Funkcja obsługująca wejście i wyjście dla interfejsu Gradio
26
  def chatbot_interface(input_text):
27
+ input_ids = tokenizer.encode(input_text, return_tensors="pt")
28
+ chatbot_output = model.generate(input_ids, max_length=100)[0]
29
+ response = tokenizer.decode(chatbot_output, skip_special_tokens=True)
30
+ return response
31
 
32
  # Interfejs Gradio dla chatbota
33
  iface = gr.Interface(