Upload 3 files
Browse files- app.py +20 -20
- quotes.csv +6 -0
- requirements.txt +2 -0
app.py
CHANGED
|
@@ -1,21 +1,21 @@
|
|
| 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 |
+
outputs='text',
|
| 16 |
+
title='Quote Generator',
|
| 17 |
+
description='Click the button to generate a random quote!'
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
# تشغيل الواجهة
|
| 21 |
interface.launch()
|
quotes.csv
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
text,category
|
| 2 |
+
"The only limit to our realization of tomorrow is our doubts of today.",Inspiration
|
| 3 |
+
"Life is what happens when you're busy making other plans.",Life
|
| 4 |
+
"The purpose of our lives is to be happy.",Happiness
|
| 5 |
+
"Get busy living or get busy dying.",Motivation
|
| 6 |
+
"You have within you right now, everything you need to deal with whatever the world can throw at you.",Wisdom
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pandas
|
| 2 |
+
gradio
|