Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 3 |
|
| 4 |
-
# Public ve CPU’da hızlı çalışan Türkçe uyumlu model
|
| 5 |
model_name = "google/mt5-small"
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
| 9 |
|
| 10 |
def generate_text(prompt):
|
|
@@ -22,8 +22,8 @@ demo = gr.Interface(
|
|
| 22 |
fn=generate_text,
|
| 23 |
inputs=gr.Textbox(label="Türkçe Metin Başlangıcı", placeholder="Bir cümle yaz..."),
|
| 24 |
outputs=gr.Textbox(label="Üretilen Metin"),
|
| 25 |
-
title="Türkçe Metin Üretici (MT5-Small)",
|
| 26 |
-
description="Hafif ve
|
| 27 |
)
|
| 28 |
|
| 29 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 3 |
|
|
|
|
| 4 |
model_name = "google/mt5-small"
|
| 5 |
|
| 6 |
+
|
| 7 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
| 8 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
| 9 |
|
| 10 |
def generate_text(prompt):
|
|
|
|
| 22 |
fn=generate_text,
|
| 23 |
inputs=gr.Textbox(label="Türkçe Metin Başlangıcı", placeholder="Bir cümle yaz..."),
|
| 24 |
outputs=gr.Textbox(label="Üretilen Metin"),
|
| 25 |
+
title="Türkçe Metin Üretici (MT5-Small, Slow Tokenizer)",
|
| 26 |
+
description="Hafif ve hızlı, CPU dostu Türkçe metin üretici."
|
| 27 |
)
|
| 28 |
|
| 29 |
demo.launch()
|