Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
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(
|