kargaranamir commited on
Commit
9555c18
1 Parent(s): abf23c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -126,22 +126,23 @@ model_2 = load_GlotLID_v2(constants.MODEL_NAME, "model_v2.bin")
126
  def plot(label, prob):
127
 
128
  ORANGE_COLOR = "#FF8000"
 
129
  fig, ax = plt.subplots(figsize=(8, 1))
130
  fig.patch.set_facecolor("none")
131
  ax.set_facecolor("none")
132
 
133
  ax.spines["left"].set_color(ORANGE_COLOR)
134
  ax.spines["bottom"].set_color(ORANGE_COLOR)
135
- ax.tick_params(axis="x", colors=ORANGE_COLOR)
136
 
137
  ax.spines[["right", "top"]].set_visible(False)
138
 
139
  ax.barh(y=[0], width=[prob], color=ORANGE_COLOR)
140
  ax.set_xlim(0, 1)
141
  ax.set_ylim(-1, 1)
142
- ax.set_title(f"Label: {label}, Language: {get_name(label)}", color=ORANGE_COLOR)
143
  ax.get_yaxis().set_visible(False)
144
- ax.set_xlabel("Confidence", color=ORANGE_COLOR)
145
  st.pyplot(fig)
146
 
147
  def compute(sentences, version = 'v2'):
 
126
  def plot(label, prob):
127
 
128
  ORANGE_COLOR = "#FF8000"
129
+ BLACK_COLOR = "#000000"
130
  fig, ax = plt.subplots(figsize=(8, 1))
131
  fig.patch.set_facecolor("none")
132
  ax.set_facecolor("none")
133
 
134
  ax.spines["left"].set_color(ORANGE_COLOR)
135
  ax.spines["bottom"].set_color(ORANGE_COLOR)
136
+ ax.tick_params(axis="x", colors=BLACK_COLOR)
137
 
138
  ax.spines[["right", "top"]].set_visible(False)
139
 
140
  ax.barh(y=[0], width=[prob], color=ORANGE_COLOR)
141
  ax.set_xlim(0, 1)
142
  ax.set_ylim(-1, 1)
143
+ ax.set_title(f"Label: {label}, Language: {get_name(label)}", color=BLACK_COLOR)
144
  ax.get_yaxis().set_visible(False)
145
+ ax.set_xlabel("Confidence", color=BLACK_COLOR)
146
  st.pyplot(fig)
147
 
148
  def compute(sentences, version = 'v2'):