renad0 commited on
Commit
15a3d2e
·
verified ·
1 Parent(s): bdc4782

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -55,49 +55,42 @@ def text_to_speech_english(text):
55
  audio_data = speech["audio"]
56
  sampling_rate = speech["sampling_rate"]
57
  return (sampling_rate, audio_data)
58
- custom_css = """
 
59
  body {
60
  background-color: #f4f4f9;
61
  color: #333;
62
  }
63
-
64
  .gradio-container {
65
  border-radius: 10px;
66
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
67
  background-color: #fff;
68
  }
69
-
70
  label {
71
  color: #4A90E2;
72
  font-weight: bold;
73
  }
74
-
75
  input[type="text"], textarea {
76
  border: 1px solid #4A90E2;
77
  }
78
-
79
  textarea {
80
  height: 150px;
81
  }
82
-
83
  button {
84
  background-color: #4A90E2;
85
  color: #fff;
86
  border-radius: 5px;
87
  cursor: pointer;
88
  }
89
-
90
  button:hover {
91
  background-color: #357ABD;
92
  }
93
-
94
  .dropdown {
95
  border: 1px solid #4A90E2;
96
  border-radius: 4px;
97
  }
98
  """
99
 
100
-
101
  examples = [
102
  #First parameter is for the dropdown menu, and the second parameter is for the starter of the poem
103
  ["Arabic", "تعتبر انبعاثات الغازات الدفيئة، مثل ثاني أكسيد الكربون (CO2) والميثان (CH4)، من الأسباب الرئيسية لتغير المناخ العالمي. تؤدي الأنشطة البشرية، مثل حرق الوقود الأحفوري لإنتاج الطاقة وإزالة الغابات والعمليات الصناعية، إلى زيادة كبيرة في تركيز هذه الغازات في الغلاف الجوي. وفقًا للهيئة الحكومية الدولية المعنية بتغير المناخ (IPCC)، ارتفعت مستويات ثاني أكسيد الكربون بأكثر من 50٪ منذ عصر ما قبل الصناعة، مما ساهم في ارتفاع درجات الحرارة العالمية."],
@@ -114,8 +107,8 @@ interface = gr.Interface(
114
  gr.Textbox(label="Generated Headline"),
115
  gr.Audio(label="Generated Audio", type="numpy")
116
  ],
117
-
118
  examples=examples,
119
- css.custum_css
120
  )
121
- interface.launch()
 
 
55
  audio_data = speech["audio"]
56
  sampling_rate = speech["sampling_rate"]
57
  return (sampling_rate, audio_data)
58
+
59
+ custom_css = """
60
  body {
61
  background-color: #f4f4f9;
62
  color: #333;
63
  }
 
64
  .gradio-container {
65
  border-radius: 10px;
66
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
67
  background-color: #fff;
68
  }
 
69
  label {
70
  color: #4A90E2;
71
  font-weight: bold;
72
  }
 
73
  input[type="text"], textarea {
74
  border: 1px solid #4A90E2;
75
  }
 
76
  textarea {
77
  height: 150px;
78
  }
 
79
  button {
80
  background-color: #4A90E2;
81
  color: #fff;
82
  border-radius: 5px;
83
  cursor: pointer;
84
  }
 
85
  button:hover {
86
  background-color: #357ABD;
87
  }
 
88
  .dropdown {
89
  border: 1px solid #4A90E2;
90
  border-radius: 4px;
91
  }
92
  """
93
 
 
94
  examples = [
95
  #First parameter is for the dropdown menu, and the second parameter is for the starter of the poem
96
  ["Arabic", "تعتبر انبعاثات الغازات الدفيئة، مثل ثاني أكسيد الكربون (CO2) والميثان (CH4)، من الأسباب الرئيسية لتغير المناخ العالمي. تؤدي الأنشطة البشرية، مثل حرق الوقود الأحفوري لإنتاج الطاقة وإزالة الغابات والعمليات الصناعية، إلى زيادة كبيرة في تركيز هذه الغازات في الغلاف الجوي. وفقًا للهيئة الحكومية الدولية المعنية بتغير المناخ (IPCC)، ارتفعت مستويات ثاني أكسيد الكربون بأكثر من 50٪ منذ عصر ما قبل الصناعة، مما ساهم في ارتفاع درجات الحرارة العالمية."],
 
107
  gr.Textbox(label="Generated Headline"),
108
  gr.Audio(label="Generated Audio", type="numpy")
109
  ],
 
110
  examples=examples,
111
+ css=custom_css
112
  )
113
+
114
+ interface.launch()