SarahMarzouq commited on
Commit
3d40d80
·
verified ·
1 Parent(s): 1417346

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -3
app.py CHANGED
@@ -35,19 +35,55 @@ def generate_headline_english(text):
35
 
36
 
37
  examples = [
38
- #First parameter is for the dropdown menu, and the second parameter is for the starter of the poem
39
  ["Arabic", "تعتبر انبعاثات الغازات الدفيئة، مثل ثاني أكسيد الكربون (CO2) والميثان (CH4)، من الأسباب الرئيسية لتغير المناخ العالمي. تؤدي الأنشطة البشرية، مثل حرق الوقود الأحفوري لإنتاج الطاقة وإزالة الغابات والعمليات الصناعية، إلى زيادة كبيرة في تركيز هذه الغازات في الغلاف الجوي. وفقًا للهيئة الحكومية الدولية المعنية بتغير المناخ (IPCC)، ارتفعت مستويات ثاني أكسيد الكربون بأكثر من 50٪ منذ عصر ما قبل الصناعة، مما ساهم في ارتفاع درجات الحرارة العالمية."],
40
  ["English", "Greenhouse gas emissions, primarily carbon dioxide (CO2) and methane (CH4), are the main drivers of global climate change. Human activities, such as burning fossil fuels for energy, deforestation, and industrial processes, have significantly increased the concentration of these gases in the atmosphere. According to the Intergovernmental Panel on Climate Change (IPCC), CO2 levels have risen by over 50% since the pre-industrial era, contributing to rising global temperatures."]
41
  ]
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  interface = gr.Interface(
44
  fn=generate_headline,
45
  inputs=[
46
  gr.Dropdown(choices=["Arabic", "English"], label="Select Language"),
47
- gr.Textbox(lines=5, placeholder="Enter article text here...")
48
  ],
49
  outputs=gr.Textbox(label="Generated Headline"),
50
 
51
- examples=examples
 
52
  )
 
53
  interface.launch()
 
35
 
36
 
37
  examples = [
 
38
  ["Arabic", "تعتبر انبعاثات الغازات الدفيئة، مثل ثاني أكسيد الكربون (CO2) والميثان (CH4)، من الأسباب الرئيسية لتغير المناخ العالمي. تؤدي الأنشطة البشرية، مثل حرق الوقود الأحفوري لإنتاج الطاقة وإزالة الغابات والعمليات الصناعية، إلى زيادة كبيرة في تركيز هذه الغازات في الغلاف الجوي. وفقًا للهيئة الحكومية الدولية المعنية بتغير المناخ (IPCC)، ارتفعت مستويات ثاني أكسيد الكربون بأكثر من 50٪ منذ عصر ما قبل الصناعة، مما ساهم في ارتفاع درجات الحرارة العالمية."],
39
  ["English", "Greenhouse gas emissions, primarily carbon dioxide (CO2) and methane (CH4), are the main drivers of global climate change. Human activities, such as burning fossil fuels for energy, deforestation, and industrial processes, have significantly increased the concentration of these gases in the atmosphere. According to the Intergovernmental Panel on Climate Change (IPCC), CO2 levels have risen by over 50% since the pre-industrial era, contributing to rising global temperatures."]
40
  ]
41
 
42
+ custom_css = """
43
+ body {
44
+ background-color: #f4f4f9;
45
+ color: #333;
46
+ }
47
+ .gradio-container {
48
+ border-radius: 10px;
49
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
50
+ background-color: #fff;
51
+ }
52
+ label {
53
+ color: #9B59B6;
54
+ font-weight: bold;
55
+ }
56
+ input[type="text"], textarea {
57
+ border: 1px solid #9B59B6;
58
+ }
59
+ textarea {
60
+ height: 150px;
61
+ }
62
+ button {
63
+ background-color: #9B59B6;
64
+ color: #fff;
65
+ border-radius: 5px;
66
+ cursor: pointer;
67
+ }
68
+ button:hover {
69
+ background-color: #8E44AD;
70
+ }
71
+ .dropdown {
72
+ border: 1px solid #9B59B6;
73
+ border-radius: 4px;
74
+ }
75
+ """
76
+
77
  interface = gr.Interface(
78
  fn=generate_headline,
79
  inputs=[
80
  gr.Dropdown(choices=["Arabic", "English"], label="Select Language"),
81
+ gr.Textbox(lines=5, placeholder="Enter article text here...", label="Text/Article")
82
  ],
83
  outputs=gr.Textbox(label="Generated Headline"),
84
 
85
+ examples=examples,
86
+ css=custom_css
87
  )
88
+
89
  interface.launch()