ghostai1 commited on
Commit
37593fc
·
verified ·
1 Parent(s): 1b18a2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -114,7 +114,7 @@ def rag_process(query, k=2):
114
 
115
  return response, retrieved_faqs, metrics
116
 
117
- # Plot RAG pipeline
118
  def plot_metrics(metrics):
119
  data = pd.DataFrame({
120
  'Stage': ['Embedding', 'Retrieval', 'Generation'],
@@ -127,13 +127,13 @@ def plot_metrics(metrics):
127
  sns.set_palette("muted")
128
 
129
  ax1 = sns.barplot(x='Stage', y='Latency (ms)', data=data, color='skyblue')
130
- ax1.set_ylabel('Latency (ms)', color='blue')
131
- ax1.tick_params(axis='y', labelcolor='blue')
132
 
133
  ax2 = ax1.twinx()
134
- sns.lineplot(x='Stage', y='Accuracy (%)', data=data, marker='o', color='red')
135
- ax2.set_ylabel('Accuracy (%)', color='red')
136
- ax2.tick_params(axis='y', labelcolor='red')
137
 
138
  plt.title('RAG Pipeline: Latency and Accuracy')
139
  plt.tight_layout()
@@ -219,13 +219,13 @@ body {
219
  background: #303030;
220
  border-radius: 8px;
221
  align-items: center;
222
- width: 100%;
223
  }
224
  #output-container {
225
  background: #303030;
226
  padding: 15px;
227
  border-radius: 8px;
228
- width: 100%;
229
  }
230
  .text-center {
231
  text-align: center;
 
114
 
115
  return response, retrieved_faqs, metrics
116
 
117
+ # Plot RAG pipeline (remove red color)
118
  def plot_metrics(metrics):
119
  data = pd.DataFrame({
120
  'Stage': ['Embedding', 'Retrieval', 'Generation'],
 
127
  sns.set_palette("muted")
128
 
129
  ax1 = sns.barplot(x='Stage', y='Latency (ms)', data=data, color='skyblue')
130
+ ax1.set_ylabel('Latency (ms)', color='skyblue')
131
+ ax1.tick_params(axis='y', labelcolor='skyblue')
132
 
133
  ax2 = ax1.twinx()
134
+ sns.lineplot(x='Stage', y='Accuracy (%)', data=data, marker='o', color='lightblue', linewidth=2)
135
+ ax2.set_ylabel('Accuracy (%)', color='lightblue')
136
+ ax2.tick_params(axis='y', labelcolor='lightblue')
137
 
138
  plt.title('RAG Pipeline: Latency and Accuracy')
139
  plt.tight_layout()
 
219
  background: #303030;
220
  border-radius: 8px;
221
  align-items: center;
222
+ width: 33%;
223
  }
224
  #output-container {
225
  background: #303030;
226
  padding: 15px;
227
  border-radius: 8px;
228
+ width: 66%;
229
  }
230
  .text-center {
231
  text-align: center;