amaniM commited on
Commit
173529a
·
verified ·
1 Parent(s): 573fe09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -20
app.py CHANGED
@@ -1,21 +1,22 @@
1
- import pandas as pd
2
- import random
3
- import gradio as gr
4
-
5
- # تحميل بيانات الاقتباسات
6
- quotes = pd.read_csv('quotes.csv')
7
-
8
- # دالة لتوليد اقتباس
9
- def display_quote():
10
- return random.choice(quotes['text'].tolist())
11
-
12
- # إنشاء واجهة Gradio
13
- interface = gr.Interface(
14
- fn=display_quote,
15
- outputs='text',
16
- title='Quote Generator',
17
- description='Click the button to generate a random quote!'
18
- )
19
-
20
- # تشغيل الواجهة
 
21
  interface.launch()
 
1
+ import pandas as pd
2
+ import random
3
+ import gradio as gr
4
+
5
+ # تحميل بيانات الاقتباسات
6
+ quotes = pd.read_csv('quotes.csv')
7
+
8
+ # دالة لتوليد اقتباس
9
+ def display_quote():
10
+ return random.choice(quotes['text'].tolist())
11
+
12
+ # إنشاء واجهة Gradio مع تحديد المدخلات والمخرجات
13
+ interface = gr.Interface(
14
+ fn=display_quote,
15
+ inputs=None, # لا توجد مدخلات
16
+ outputs='text',
17
+ title='Quote Generator',
18
+ description='Click the button to generate a random quote!'
19
+ )
20
+
21
+ # تشغيل الواجهة
22
  interface.launch()