KAARIN commited on
Commit
3fff809
1 Parent(s): 7147c6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -34,12 +34,12 @@ print(PIL.__version__)
34
 
35
  # İkon etiketlerini ve değerlerini eşlemek için bir sözlük oluşturun
36
  icon_map = {
37
- "Araba": "fas fa-car",
38
- "Hilal ve Yıldız": "fas fa-star-and-crescent",
39
- "Kupa": "fas fa-trophy",
40
- "Kalp": "fas fa-heart",
41
- "Bulut": "fas fa-cloud",
42
- "Hediye": "fas fa-gift"
43
  }
44
 
45
  def create_stylecloud(file, text_input, language, icon_label):
@@ -67,26 +67,26 @@ def create_stylecloud(file, text_input, language, icon_label):
67
  return image
68
 
69
  with gr.Blocks() as demo:
70
- gr.Markdown('Kelime Bulutu Oluşturucu')
71
 
72
  with gr.Row():
73
- input_choice = gr.Radio(choices=['Dosya Yükle', 'Metin Gir'], label='Girdi Seçimi', value='Dosya Yükle')
74
 
75
  with gr.Row(visible=True) as file_input_row:
76
- file_input = gr.File(label='Metin Dosyası Yükle', type='binary')
77
 
78
  with gr.Row(visible=False) as text_input_row:
79
- text_input = gr.Textbox(label='Metin Gir')
80
 
81
  with gr.Row():
82
- language = gr.Radio(choices=['TR', 'EN'], label='Dil Seçimi', value='TR')
83
 
84
  with gr.Row():
85
- icon = gr.Dropdown(choices=list(icon_map.keys()), label='İkon Seçimi', value='Hilal ve Yıldız')
86
 
87
  with gr.Row():
88
- create_button = gr.Button('Oluştur')
89
- output_image = gr.Image(label='Kelime Bulutu')
90
 
91
  # butona basıldığında
92
  create_button.click(
@@ -96,7 +96,7 @@ with gr.Blocks() as demo:
96
  )
97
 
98
  def update_input_visibility(choice):
99
- if choice == 'Dosya Yükle':
100
  return gr.update(visible=True), gr.update(visible=False)
101
  else:
102
  return gr.update(visible=False), gr.update(visible=True)
 
34
 
35
  # İkon etiketlerini ve değerlerini eşlemek için bir sözlük oluşturun
36
  icon_map = {
37
+ "Car": "fas fa-car",
38
+ "Crescent and Star": "fas fa-star-and-crescent",
39
+ "Trophy": "fas fa-trophy",
40
+ "Heart": "fas fa-heart",
41
+ "Cloud": "fas fa-cloud",
42
+ "Gift": "fas fa-gift"
43
  }
44
 
45
  def create_stylecloud(file, text_input, language, icon_label):
 
67
  return image
68
 
69
  with gr.Blocks() as demo:
70
+ gr.Markdown('Word Cloud Generater')
71
 
72
  with gr.Row():
73
+ input_choice = gr.Radio(choices=['Upload Your File', 'Enter Your Text'], label='Select Text Upload Format', value='Upload Your File')
74
 
75
  with gr.Row(visible=True) as file_input_row:
76
+ file_input = gr.File(label='Upload Text File', type='binary')
77
 
78
  with gr.Row(visible=False) as text_input_row:
79
+ text_input = gr.Textbox(label='Enter Your Text')
80
 
81
  with gr.Row():
82
+ language = gr.Radio(choices=['TR', 'EN'], label='Language', value='TR')
83
 
84
  with gr.Row():
85
+ icon = gr.Dropdown(choices=list(icon_map.keys()), label='Icon Selection', value='Crescent and Star')
86
 
87
  with gr.Row():
88
+ create_button = gr.Button('Generate')
89
+ output_image = gr.Image(label='Word Cloud')
90
 
91
  # butona basıldığında
92
  create_button.click(
 
96
  )
97
 
98
  def update_input_visibility(choice):
99
+ if choice == 'Upload Your File':
100
  return gr.update(visible=True), gr.update(visible=False)
101
  else:
102
  return gr.update(visible=False), gr.update(visible=True)