Francesco-A commited on
Commit
084c343
1 Parent(s): 665620b
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -77,7 +77,7 @@ contexts = [
77
  # Function to find similar answers in a list of contexts
78
  def QA_similarity(question, contexts, n_answers=1):
79
 
80
- context_df = pd.DataFrame(contexts,columns=['Context'])
81
  contexts = context_df['Context'].to_list()
82
 
83
  # to use 'clips/mfaq' questions need to be prepended with <Q>, and answers with <A>.
@@ -113,8 +113,14 @@ def QA_similarity(question, contexts, n_answers=1):
113
  return df
114
 
115
  # %% ../drive/MyDrive/Codici/Python/Gradio_App/SemanticSearch_QA-v1.ipynb 7
116
- answer_example = pd.DataFrame(list(contexts), columns=['Context'])
117
- a_text = gr.components.Dataframe(answer_example,col_count=(1,"fixed"))
 
 
 
 
 
 
118
 
119
  n_slider = gr.components.Slider(minimum=1, maximum = 10, label = "Select n answers (max= 10)",step = 1)
120
 
 
77
  # Function to find similar answers in a list of contexts
78
  def QA_similarity(question, contexts, n_answers=1):
79
 
80
+
81
  contexts = context_df['Context'].to_list()
82
 
83
  # to use 'clips/mfaq' questions need to be prepended with <Q>, and answers with <A>.
 
113
  return df
114
 
115
  # %% ../drive/MyDrive/Codici/Python/Gradio_App/SemanticSearch_QA-v1.ipynb 7
116
+
117
+ data = {
118
+ 'Context': contexts,
119
+ }
120
+
121
+ context_df = pd.DataFrame(data)
122
+
123
+ a_text = gr.components.Dataframe(context_df,col_count=(1,"fixed"))
124
 
125
  n_slider = gr.components.Slider(minimum=1, maximum = 10, label = "Select n answers (max= 10)",step = 1)
126