SuperSl6 commited on
Commit
d1b79e0
·
verified ·
1 Parent(s): 55c967e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ # Load the model using pipeline
5
+ model = pipeline("text2text-generation", model="SuperSl6/Arabic-Text-Correction")
6
+
7
+ def correct_text(input_text):
8
+ result = model(input_text)[0]['generated_text']
9
+ return result
10
+
11
+ # Gradio Interface
12
+ interface = gr.Interface(
13
+ fn=correct_text,
14
+ inputs=gr.Textbox(lines=3, placeholder="أدخل النص العربي هنا..."),
15
+ outputs=gr.Textbox(),
16
+ live=True, # Real-time processing
17
+ title="تصحيح النص العربي",
18
+ description="أداة لتصحيح النصوص العربية باستخدام نموذج SuperSl6/Arabic-Text-Correction."
19
+ )
20
+
21
+ # Launch the app
22
+ interface.launch(debug=True)