Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
# Wczytywanie modelu Bielik-7B | |
model = pipeline("text-generation", model="speakleash/Bielik-7B-v0.1") | |
def generate_description(product_name, product_features): | |
prompt = ( | |
f"Opisz produkt o nazwie {product_name}, kt贸ry posiada nast臋puj膮ce cechy: {product_features}. " | |
"Podaj jego g艂贸wne zalety, zastosowania i cechy wyr贸偶niaj膮ce. Wyja艣nij, dlaczego warto go kupi膰." | |
) | |
result = model(prompt, max_length=200, temperature=0.7, top_p=0.9) | |
return result[0]['generated_text'] | |
# Konfiguracja interfejsu Gradio | |
iface = gr.Interface( | |
fn=generate_description, | |
inputs=["text", "text"], | |
outputs="text", | |
title="Bielik-7B Product Description Generator", | |
description="Wprowad藕 nazw臋 produktu i jego cechy, aby wygenerowa膰 opis." | |
) | |
if __name__ == "__main__": | |
iface.launch() | |