Spaces:
Runtime error
Runtime error
File size: 463 Bytes
fa3848c c9a2d7a fa3848c 40a936c 10e238a b6027f8 c9a2d7a fa3848c |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
from fastai.text.all import *
import gradio as gr
model = load_learner("llmf.pkl")
def txt_gen(txt, n_words=45, n_sents=2):
a = [model.predict(txt,n_words,temperature=0.9) for _ in range(n_sents)]
return "\n".join(a)
sents = gr.components.Textbox()
outs = gr.components.Textbox()
examples=["جنگ جهانی دوم رو " ,"شعر و شاعری "]
intf = gr.Interface(fn=txt_gen, inputs=sents, outputs=outs, examples=examples)
intf.launch(inline=False) |