Spaces:
Runtime error
Runtime error
File size: 533 Bytes
30fe1a0 70fe0b3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import gradio as gr
gr.Interface.load("models/alger-ia/dziribert").launch()
def predict(text):
return pipe(text)[0]["translation_text"]
generated_text_set = set()
for i in range(50):
result = fill_mask(text)
r = result[random.randint(0, 4)]["sequence"]
if r not in generated_text_set:
print(r)
text = r + " [MASK]"
generated_text_set.add(r)
else:
continue
iface = gr.Interface(
fn=predict,
inputs='text',
outputs='text',
examples=[["أنا [MASK]"]]
)
iface.launch() |