Update app.py
Browse files1234567891011 unmodified lines2223242526272829import gradio as grfrom transformers import AutoTokenizer, AutoModelForSeq2SeqLM# Public ve CPU’da hızlı çalışan Türkçe uyumlu modelmodel_name = "google/mt5-small"tokenizer = AutoTokenizer.from_pretrained(model_name)model = AutoModelForSeq2SeqLM.from_pretrained(model_name)def generate_text(prompt):11 unmodified linesfn=generate_text,inputs=gr.Textbox(label="Türkçe Metin Başlangıcı", placeholder="Bir cümle yaz..."),outputs=gr.Textbox(label="Üretilen Metin"),title="Türkçe Metin Üretici (MT5-Small)",description="Hafif ve hızlı bir Türkçe metin üretici. CPU’da çalışır.")demo.launch()1234567891011 unmodified lines2223242526272829import gradio as grfrom transformers import AutoTokenizer, AutoModelForSeq2SeqLMmodel_name = "google/mt5-small"tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)model = AutoModelForSeq2SeqLM.from_pretrained(model_name)def generate_text(prompt):11 unmodified linesfn=generate_text,inputs=gr.Textbox(label="Türkçe Metin Başlangıcı", placeholder="Bir cümle yaz..."),outputs=gr.Textbox(label="Üretilen Metin"),title="Türkçe Metin Üretici (MT5-Small, Slow Tokenizer)",description="Hafif ve hızlı, CPU dostu Türkçe metin üretici.")demo.launch()
app.py+4-4