Downloads · 30 days
0
ahmetp/hikayeolusturucu
hikayeolusturucu is a machine learning model from ahmetp. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
import gradio as gr from transformers import pipeline, setseed
Downloads · 30 days
0
Access
Public
Updated Apr 29, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 59%
From the Hugging Face model README
import gradio as gr from transformers import pipeline, set_seed
story_generator = pipeline("text-generation", model="gpt2") # İstersen 'tiiuae/falcon-rw-1b' gibi modelleri de deneyebilirsin set_seed(42)
def generate_story(keyword1, keyword2, keyword3): prompt = f"Bir varmış bir yokmuş, {keyword1}, {keyword2} ve {keyword3} adında üç sevimli kahraman varmış. " story = story_generator(prompt, max_length=200, num_return_sequences=1)[0]["generated_text"] return story
interface = gr.Interface( fn=generate_story, inputs=[ gr.Textbox(label="1. Anahtar Kelime"), gr.Textbox(label="2. Anahtar Kelime"), gr.Textbox(label="3. Anahtar Kelime") ], outputs=gr.Textbox(label="Oluşturulan Hikaye"), title="🧒 Çocuk Hikayesi Oluşturucu", description="Üç kelime girin, sizin için eğlenceli bir çocuk hikayesi oluşturalım!" )
interface.launch()